summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2012-05-04 16:55:03 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2012-05-04 16:55:03 +0200
commit02cb61dcb7a120b7a5f7a480fd2b43f49e28dafc (patch)
treeedf966badb4598c88e3f606e1c24751c01c1f6d6
parent39a0fae4682502c420818ec11ca6dbb745041c4b (diff)
ipv6: Add fragment reporting to ipv6_skip_exthdr().
While parsing through IPv6 extension headers, fragment headers are skipped making them invisible to the caller. This reports the fragment offset of the last header in order to make it possible to determine whether the packet is fragmented and, if so whether it is a first or last fragment. Signed-off-by: Jesse Gross <jesse@nicira.com>
-rw-r--r--kernel/net/netfilter/ipset/ip_set_getport.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/net/netfilter/ipset/ip_set_getport.c b/kernel/net/netfilter/ipset/ip_set_getport.c
index a66c67b..bfe535d 100644
--- a/kernel/net/netfilter/ipset/ip_set_getport.c
+++ b/kernel/net/netfilter/ipset/ip_set_getport.c
@@ -119,9 +119,17 @@ ip_set_get_ip6_port(const struct sk_buff *skb, bool src,
{
int protoff;
u8 nexthdr;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
+ __be16 frag_off;
+#endif
nexthdr = ipv6_hdr(skb)->nexthdr;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
+ protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr,
+ &frag_off);
+#else
protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr);
+#endif
if (protoff < 0)
return false;