From 0ab182b2e7c32ef9bd5db82fc683a7c03750a796 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 17 Mar 2020 15:04:16 -0600 Subject: 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 Signed-off-by: Jason A. Donenfeld --- src/receive.c | 3 +-- 1 file changed, 1 insertion(+), 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; -- cgit v1.2.3-59-g8ed1b