Skip to content

Commit

Permalink
net: fou: remove redundant code in gue_udp_recv
Browse files Browse the repository at this point in the history
Remove not useful protocol version check in gue_udp_recv since just
gue version 0 can hit that code. Moreover remove duplicated hdrlen
computation

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lorenzo Bianconi authored and David S. Miller committed Apr 11, 2019
1 parent c9d52f2 commit 526bb57
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/ipv4/fou.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 526bb57

Please sign in to comment.