From fa15260972b5ee645ba0992c3e21ae90f152a41b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 3 Sep 2018 00:11:26 -0600 Subject: global: satisfy check_patch.pl errors --- src/allowedips.c | 4 ++-- src/device.c | 5 +++-- src/netlink.c | 36 ++++++++++++++++++------------------ src/ratelimiter.c | 4 ++-- src/tests/netns.sh | 2 +- src/timers.c | 2 +- 6 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/allowedips.c b/src/allowedips.c index 4616645..14f8e13 100644 --- a/src/allowedips.c +++ b/src/allowedips.c @@ -57,8 +57,8 @@ static void node_free_rcu(struct rcu_head *rcu) }) static void root_free_rcu(struct rcu_head *rcu) { - struct allowedips_node *node, *stack[128] = - { container_of(rcu, struct allowedips_node, rcu) }; + struct allowedips_node *node, *stack[128] = { + container_of(rcu, struct allowedips_node, rcu) }; unsigned int len = 1; while (len > 0 && (node = stack[--len]) && diff --git a/src/device.c b/src/device.c index 3dfa794..5bdc649 100644 --- a/src/device.c +++ b/src/device.c @@ -407,8 +407,9 @@ static int netdevice_notification(struct notifier_block *nb, return 0; } -static struct notifier_block netdevice_notifier = - { .notifier_call = netdevice_notification }; +static struct notifier_block netdevice_notifier = { + .notifier_call = netdevice_notification +}; int __init device_init(void) { diff --git a/src/netlink.c b/src/netlink.c index 8ffaa66..63f3794 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -17,27 +17,27 @@ static struct genl_family genl_family; static const struct nla_policy device_policy[WGDEVICE_A_MAX + 1] = { - [WGDEVICE_A_IFINDEX] = { .type = NLA_U32 }, - [WGDEVICE_A_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ - 1 }, - [WGDEVICE_A_PRIVATE_KEY]= { .len = NOISE_PUBLIC_KEY_LEN }, - [WGDEVICE_A_PUBLIC_KEY] = { .len = NOISE_PUBLIC_KEY_LEN }, - [WGDEVICE_A_FLAGS] = { .type = NLA_U32 }, - [WGDEVICE_A_LISTEN_PORT]= { .type = NLA_U16 }, - [WGDEVICE_A_FWMARK] = { .type = NLA_U32 }, - [WGDEVICE_A_PEERS] = { .type = NLA_NESTED } + [WGDEVICE_A_IFINDEX] = { .type = NLA_U32 }, + [WGDEVICE_A_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ - 1 }, + [WGDEVICE_A_PRIVATE_KEY] = { .len = NOISE_PUBLIC_KEY_LEN }, + [WGDEVICE_A_PUBLIC_KEY] = { .len = NOISE_PUBLIC_KEY_LEN }, + [WGDEVICE_A_FLAGS] = { .type = NLA_U32 }, + [WGDEVICE_A_LISTEN_PORT] = { .type = NLA_U16 }, + [WGDEVICE_A_FWMARK] = { .type = NLA_U32 }, + [WGDEVICE_A_PEERS] = { .type = NLA_NESTED } }; static const struct nla_policy peer_policy[WGPEER_A_MAX + 1] = { - [WGPEER_A_PUBLIC_KEY] = { .len = NOISE_PUBLIC_KEY_LEN }, - [WGPEER_A_PRESHARED_KEY] = { .len = NOISE_SYMMETRIC_KEY_LEN }, - [WGPEER_A_FLAGS] = { .type = NLA_U32 }, - [WGPEER_A_ENDPOINT] = { .len = sizeof(struct sockaddr) }, - [WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL]= { .type = NLA_U16 }, - [WGPEER_A_LAST_HANDSHAKE_TIME] = { .len = sizeof(struct timespec) }, - [WGPEER_A_RX_BYTES] = { .type = NLA_U64 }, - [WGPEER_A_TX_BYTES] = { .type = NLA_U64 }, - [WGPEER_A_ALLOWEDIPS] = { .type = NLA_NESTED }, - [WGPEER_A_PROTOCOL_VERSION] = { .type = NLA_U32 } + [WGPEER_A_PUBLIC_KEY] = { .len = NOISE_PUBLIC_KEY_LEN }, + [WGPEER_A_PRESHARED_KEY] = { .len = NOISE_SYMMETRIC_KEY_LEN }, + [WGPEER_A_FLAGS] = { .type = NLA_U32 }, + [WGPEER_A_ENDPOINT] = { .len = sizeof(struct sockaddr) }, + [WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL] = { .type = NLA_U16 }, + [WGPEER_A_LAST_HANDSHAKE_TIME] = { .len = sizeof(struct timespec) }, + [WGPEER_A_RX_BYTES] = { .type = NLA_U64 }, + [WGPEER_A_TX_BYTES] = { .type = NLA_U64 }, + [WGPEER_A_ALLOWEDIPS] = { .type = NLA_NESTED }, + [WGPEER_A_PROTOCOL_VERSION] = { .type = NLA_U32 } }; static const struct nla_policy allowedip_policy[WGALLOWEDIP_A_MAX + 1] = { diff --git a/src/ratelimiter.c b/src/ratelimiter.c index 3966ce8..836b4a6 100644 --- a/src/ratelimiter.c +++ b/src/ratelimiter.c @@ -84,8 +84,8 @@ static void gc_entries(struct work_struct *work) bool ratelimiter_allow(struct sk_buff *skb, struct net *net) { - struct { __be64 ip; u32 net; } data = - { .net = (unsigned long)net & 0xffffffff }; + struct { __be64 ip; u32 net; } data = { + .net = (unsigned long)net & 0xffffffff }; struct ratelimiter_entry *entry; struct hlist_head *bucket; diff --git a/src/tests/netns.sh b/src/tests/netns.sh index 29e1fd4..568612c 100755 --- a/src/tests/netns.sh +++ b/src/tests/netns.sh @@ -15,7 +15,7 @@ # ││fd00::1/24 ││ │ │127.0.0.1:1 127.0.0.1:2│ │ ││fd00::2/24 ││ # │└───────────────────┘│ │ │[::]:1 [::]:2 │ │ │└───────────────────┘│ # └─────────────────────┘ │ └─────────────────────────┘ │ └─────────────────────┘ -# └──────────────────────────────────┘ +# └──────────────────────────────────┘ # # After the topology is prepared we run a series of TCP/UDP iperf3 tests between the # wireguard peers in $ns1 and $ns2. Note that $ns0 is the endpoint for the wg0 diff --git a/src/timers.c b/src/timers.c index ad76466..fead499 100644 --- a/src/timers.c +++ b/src/timers.c @@ -177,7 +177,7 @@ void timers_data_received(struct wireguard_peer *peer) /* Should be called after any type of authenticated packet is sent, whether * keepalive, data, or handshake. -*/ + */ void timers_any_authenticated_packet_sent(struct wireguard_peer *peer) { del_peer_timer(peer, &peer->timer_send_keepalive); -- cgit v1.2.3-59-g8ed1b