]> granicus.if.org Git - ipset/commitdiff
ipv6: Add fragment reporting to ipv6_skip_exthdr().
authorJesse Gross <jesse@nicira.com>
Fri, 4 May 2012 14:55:03 +0000 (16:55 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 4 May 2012 14:55:03 +0000 (16:55 +0200)
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>
kernel/net/netfilter/ipset/ip_set_getport.c

index a66c67bf922e63000d3752dae25efa09c9508424..bfe535de3fcf64a3ee9669fbde757be2d42bbee6 100644 (file)
@@ -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;