summaryrefslogtreecommitdiffstats
path: root/net/ipv4/fou.c
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>2019-04-09 12:03:07 +0200
committerDavid S. Miller <davem@davemloft.net>2019-04-11 09:08:51 +0200
commit526bb57a6ad6b0ed6de34b3c5eabf394b248618f (patch)
treececc25880710856f01ac24febf76ebc399a64b8b /net/ipv4/fou.c
parentfou: correct spelling of encapsulation (diff)
downloadlinux-526bb57a6ad6b0ed6de34b3c5eabf394b248618f.tar.xz
linux-526bb57a6ad6b0ed6de34b3c5eabf394b248618f.zip
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 Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/ipv4/fou.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
index d2a2f3258e4b..b038f563baa4 100644
--- a/net/ipv4/fou.c
+++ b/net/ipv4/fou.c
@@ -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;