linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / bridge / netfilter / ebt_ip.c
index 7323805..dc5d0b2 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/netfilter_bridge/ebtables.h>
 #include <linux/netfilter_bridge/ebt_ip.h>
 #include <linux/ip.h>
+#include <net/ip.h>
 #include <linux/in.h>
 #include <linux/module.h>
 
@@ -51,6 +52,8 @@ static int ebt_filter_ip(const struct sk_buff *skb, const struct net_device *in,
                if (!(info->bitmask & EBT_IP_DPORT) &&
                    !(info->bitmask & EBT_IP_SPORT))
                        return EBT_MATCH;
+               if (ntohs(ih->frag_off) & IP_OFFSET)
+                       return EBT_NOMATCH;
                pptr = skb_header_pointer(skb, ih->ihl*4,
                                          sizeof(_ports), &_ports);
                if (pptr == NULL)
@@ -89,7 +92,9 @@ static int ebt_ip_check(const char *tablename, unsigned int hookmask,
                if (info->invflags & EBT_IP_PROTO)
                        return -EINVAL;
                if (info->protocol != IPPROTO_TCP &&
-                   info->protocol != IPPROTO_UDP)
+                   info->protocol != IPPROTO_UDP &&
+                   info->protocol != IPPROTO_SCTP &&
+                   info->protocol != IPPROTO_DCCP)
                         return -EINVAL;
        }
        if (info->bitmask & EBT_IP_DPORT && info->dport[0] > info->dport[1])