diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-31 11:24:54 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-10-31 17:25:23 +0100 |
commit | d03f2a0805fade7048de215ab809b4b5927a7356 (patch) | |
tree | 2a9c1cf04e091c45976637c1faf5ba348c24d9d0 /src/receive.c | |
parent | timers: guard entire setting in block (diff) | |
download | wireguard-monolithic-historical-d03f2a0805fade7048de215ab809b4b5927a7356.tar.xz wireguard-monolithic-historical-d03f2a0805fade7048de215ab809b4b5927a7356.zip |
global: use fewer BUG_ONs
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r-- | src/receive.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/receive.c b/src/receive.c index 36502dc..2e91b67 100644 --- a/src/receive.c +++ b/src/receive.c @@ -147,13 +147,13 @@ static void receive_handshake_packet(struct wireguard_device *wg, struct sk_buff } break; } - default: + } + + if (unlikely(!peer)) { WARN(1, "Somehow a wrong type of packet wound up in the handshake queue!\n"); return; } - BUG_ON(!peer); - local_bh_disable(); rx_stats(peer, skb->len); local_bh_enable(); |