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