aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-03-17 15:04:16 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2020-03-17 22:24:17 -0600
commit0ab182b2e7c32ef9bd5db82fc683a7c03750a796 (patch)
tree93bd8f05892738b55a4ddcf02c5bd7978aac64ed
parentb9d186323ddbc4cbd793ef49002b4a4107d6a8aa (diff)
downloadwireguard-linux-compat-0ab182b2e7c32ef9bd5db82fc683a7c03750a796.tar.gz
receive: remove dead code from default packet type case
The situation in which we wind up hitting the default case here indicates a major bug in earlier parsing code. It is not a usual thing that should ever happen, which means a "friendly" message for it doesn't make sense. Rather, replace this with a WARN_ON, just like we do earlier in the file for a similar situation, so that somebody sends us a bug report and we can fix it. Reported-by: Fabian Freyer <fabianfreyer@radicallyopensecurity.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/receive.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/receive.c b/src/receive.c
index dde4109..c63b7a9 100644
--- a/src/receive.c
+++ b/src/receive.c
@@ -597,8 +597,7 @@ void wg_packet_receive(struct wg_device *wg, struct sk_buff *skb)
wg_packet_consume_data(wg, skb);
break;
default:
- net_dbg_skb_ratelimited("%s: Invalid packet from %pISpfsc\n",
- wg->dev->name, skb);
+ WARN(1, "Non-exhaustive parsing of packet header lead to unknown packet type!\n");
goto err;
}
return;