diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-10-08 22:54:32 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-10-09 01:57:47 +0200 |
commit | f985de2c5acc9a9086829d52237fce0d2a663277 (patch) | |
tree | 28ce187bcd7aad1e03ab92f7ec9695d343f44973 /src/selftest | |
parent | main: change module description (diff) | |
download | wireguard-monolithic-historical-f985de2c5acc9a9086829d52237fce0d2a663277.tar.xz wireguard-monolithic-historical-f985de2c5acc9a9086829d52237fce0d2a663277.zip |
global: give if statements brackets and other cleanups
Diffstat (limited to 'src/selftest')
-rw-r--r-- | src/selftest/allowedips.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/selftest/allowedips.c b/src/selftest/allowedips.c index fdedfef..74d1472 100644 --- a/src/selftest/allowedips.c +++ b/src/selftest/allowedips.c @@ -72,6 +72,7 @@ static __init void print_node(struct allowedips_node *node, u8 bits) print_node(node->bit[1], bits); } } + static __init void print_tree(struct allowedips_node *top, u8 bits) { printk(KERN_DEBUG "digraph trie {\n"); @@ -135,9 +136,9 @@ static __init inline u8 horrible_mask_to_cidr(union nf_inet_addr subnet) static __init inline void horrible_mask_self(struct horrible_allowedips_node *node) { - if (node->ip_version == 4) + if (node->ip_version == 4) { node->ip.ip &= node->mask.ip; - else if (node->ip_version == 6) { + } else if (node->ip_version == 6) { node->ip.ip6[0] &= node->mask.ip6[0]; node->ip.ip6[1] &= node->mask.ip6[1]; node->ip.ip6[2] &= node->mask.ip6[2]; @@ -487,6 +488,7 @@ static __init int walk_callback(void *ctx, const u8 *ip, u8 cidr, int family) static __init struct wg_peer *init_peer(void) { struct wg_peer *peer = kzalloc(sizeof(*peer), GFP_KERNEL); + if (peer) kref_init(&peer->refcount); return peer; |