[Swan-commit] Changes to ref refs/heads/master
D. Hugh Redelmeier
hugh at vault.libreswan.fi
Thu Apr 24 23:36:47 EEST 2014
New commits:
commit 96aaa307e17f24f7d8a4cce7f67b7b76cc307693
Author: D. Hugh Redelmeier <hugh at mimosa.com>
Date: Thu Apr 24 16:36:27 2014 -0400
starting from an issue in ikev2_out_nat_v2n, I got a lot of places:
- ikev2_natd_lookup:
+ don't zero st->hidden_variables.st_natd after setting it
+ reorganize for clarity
- natd_hash: change port parameter to be passed in host order (simplification)
- for V2 natd hashing, define and use IKEV2_NATD_HASH_SIZE
- ship_v2N: make spi and n_data parameters const
- use empty_chunk instead of custom constructed equivalents for ship_v2N calls
- all calls to ship_v2N should handle failure
- all calls to ikev2_out_nat_v2n should handle failure
- in calls to ship_v2N for parent, protoid should be 0 and SPI should be empty:
clarified calls and fixed some incorrect ones
- send_v2_notification: remove #if 0 code
/* Empty notification data section should be fine? */
- chunk_t values must not be initialized by zero() (The C standard allows
a null pointer representation to have non-zero bytes.)
- style: keep auto variables as local as possible
- style: some formatting changes:
+ in a block, declarations should come before statements
and be separated by a blank line
+ no spaces after '(' or before ')'
- style: some calls to out_raw are better done by calls to out_chunk
- style: some calls to memset are better done by calls to zero()
- style: don't use pointers in a boolean context: compare them with NULL
- style: don't use an lset_t value as an operand of !: compare it with LEMPTY
- style: try to avoid double-negatives, they are hard to read.
It sometimes helps to flip then and else parts.
- style: almost all calls to memcmp can be simplified to calls of memeq
- style: comma is almost always followed by newline, space, or tab
Not tested.
More information about the Swan-commit
mailing list