diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-11-11 22:35:07 -0500 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-11-13 00:34:16 -0800 |
commit | 87611c1f178ba59b682801574e930e5229fc2d2f (patch) | |
tree | c98bb2dcdbfdc3af95ad04c7e3cc817d4a136291 /src/allowedips.c | |
parent | wg-quick: android: do not choke on empty allowed-ips (diff) | |
download | wireguard-monolithic-historical-87611c1f178ba59b682801574e930e5229fc2d2f.tar.xz wireguard-monolithic-historical-87611c1f178ba59b682801574e930e5229fc2d2f.zip |
global: various formatting tweeks
Diffstat (limited to 'src/allowedips.c')
-rw-r--r-- | src/allowedips.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/allowedips.c b/src/allowedips.c index b99078d..2de752d 100644 --- a/src/allowedips.c +++ b/src/allowedips.c @@ -39,7 +39,7 @@ static void copy_and_assign_cidr(struct allowedips_node *node, const u8 *src, node->bit_at_b = 7U - (cidr % 8U); memcpy(node->bits, src, bits / 8U); } -#define CHOOSE_NODE(parent, key) \ +#define CHOOSE_NODE(parent, key) \ parent->bit[(key[parent->bit_at_a] >> parent->bit_at_b) & 1] static void node_free_rcu(struct rcu_head *rcu) @@ -338,8 +338,7 @@ void wg_allowedips_free(struct allowedips *table, struct mutex *lock) } int wg_allowedips_insert_v4(struct allowedips *table, const struct in_addr *ip, - u8 cidr, struct wg_peer *peer, - struct mutex *lock) + u8 cidr, struct wg_peer *peer, struct mutex *lock) { /* Aligned so it can be passed to fls */ u8 key[4] __aligned(__alignof(u32)); @@ -350,8 +349,7 @@ int wg_allowedips_insert_v4(struct allowedips *table, const struct in_addr *ip, } int wg_allowedips_insert_v6(struct allowedips *table, const struct in6_addr *ip, - u8 cidr, struct wg_peer *peer, - struct mutex *lock) + u8 cidr, struct wg_peer *peer, struct mutex *lock) { /* Aligned so it can be passed to fls64 */ u8 key[16] __aligned(__alignof(u64)); @@ -362,8 +360,7 @@ int wg_allowedips_insert_v6(struct allowedips *table, const struct in6_addr *ip, } void wg_allowedips_remove_by_peer(struct allowedips *table, - struct wg_peer *peer, - struct mutex *lock) + struct wg_peer *peer, struct mutex *lock) { ++table->seq; walk_remove_by_peer(&table->root4, peer, lock); |