diff options
author | Lorenzo Bianconi <lorenzo.bianconi@redhat.com> | 2019-04-09 13:03:07 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-11 10:08:51 +0300 |
commit | 526bb57a6ad6b0ed6de34b3c5eabf394b248618f (patch) | |
tree | cecc25880710856f01ac24febf76ebc399a64b8b /net | |
parent | c9d52f216922425b56b002100b75de34b62b11a0 (diff) | |
download | linux-526bb57a6ad6b0ed6de34b3c5eabf394b248618f.tar.xz |
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 'net')
-rw-r--r-- | net/ipv4/fou.c | 4 |
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; |