Skip to contentSkip to conversation

net: fou: remove redundant code in gue_udp_recv

PATCH Applied Lorenzo Bianconi 2 participants 2 messages Apr 9, 2019 – Apr 11, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 net: fou: remove redundant code in gue_udp_recv

Remove not useful protocol version check in gue_udp_recv since just gue version 0 can hit that code. Moreover remove duplicated hdrlen computation

---
 net/ipv4/fou.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/ipv4/fou.c +1 -3
index 100e63f57ea6..c2da9314a06c 100644
@@ -170,9 +170,7 @@ static int gue_udp_recv(struct sock *sk, struct sk_buff *skb)
 	/* guehdr may change after pull */
 	guehdr = (struct guehdr *)&udp_hdr(skb)[1];
 
-	hdrlen = sizeof(struct guehdr) + optlen;
-
-	if (guehdr->version != 0 || validate_gue_flags(guehdr, optlen))
+	if (validate_gue_flags(guehdr, optlen))
 		goto drop;
 
 	hdrlen = sizeof(struct guehdr) + optlen;
Signature · 1 line
2.20.1