[IPv4] ESP: Discard dummy packets introduced in rfc4303

RFC4303 introduces dummy packets with a nexthdr value of 59
to implement traffic confidentiality. Such packets need to
be dropped silently and the payload may not be attempted to
be parsed as it consists of random chunk.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Thomas Graf and committed by David S. Miller 2017a72c a4e65d36

+5
+5
net/ipv4/esp4.c
··· 9 9 #include <linux/pfkeyv2.h> 10 10 #include <linux/random.h> 11 11 #include <linux/spinlock.h> 12 + #include <linux/in6.h> 12 13 #include <net/icmp.h> 13 14 #include <net/protocol.h> 14 15 #include <net/udp.h> ··· 224 223 goto out; 225 224 226 225 /* ... check padding bits here. Silly. :-) */ 226 + 227 + /* RFC4303: Drop dummy packets without any error */ 228 + if (nexthdr[1] == IPPROTO_NONE) 229 + goto out; 227 230 228 231 iph = ip_hdr(skb); 229 232 ihl = iph->ihl * 4;