]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/ipt_ah.c
Merge branch 'fix/hda' into topic/hda
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / ipt_ah.c
index e977989629c79139ff844b91598aeef7a3c0c781..0104c0b399de5ca3efc6ba58ff8ada6aa8b6de43 100644 (file)
@@ -36,27 +36,23 @@ spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
        return r;
 }
 
-static bool
-ah_mt(const struct sk_buff *skb, const struct net_device *in,
-      const struct net_device *out, const struct xt_match *match,
-      const void *matchinfo, int offset, unsigned int protoff, bool *hotdrop)
+static bool ah_mt(const struct sk_buff *skb, const struct xt_match_param *par)
 {
        struct ip_auth_hdr _ahdr;
        const struct ip_auth_hdr *ah;
-       const struct ipt_ah *ahinfo = matchinfo;
+       const struct ipt_ah *ahinfo = par->matchinfo;
 
        /* Must not be a fragment. */
-       if (offset)
+       if (par->fragoff != 0)
                return false;
 
-       ah = skb_header_pointer(skb, protoff,
-                               sizeof(_ahdr), &_ahdr);
+       ah = skb_header_pointer(skb, par->thoff, sizeof(_ahdr), &_ahdr);
        if (ah == NULL) {
                /* We've been asked to examine this packet, and we
                 * can't.  Hence, no choice but to drop.
                 */
                duprintf("Dropping evil AH tinygram.\n");
-               *hotdrop = true;
+               *par->hotdrop = true;
                return 0;
        }
 
@@ -65,13 +61,9 @@ ah_mt(const struct sk_buff *skb, const struct net_device *in,
                         !!(ahinfo->invflags & IPT_AH_INV_SPI));
 }
 
-/* Called when user tries to insert an entry of this type. */
-static bool
-ah_mt_check(const char *tablename, const void *ip_void,
-            const struct xt_match *match, void *matchinfo,
-            unsigned int hook_mask)
+static bool ah_mt_check(const struct xt_mtchk_param *par)
 {
-       const struct ipt_ah *ahinfo = matchinfo;
+       const struct ipt_ah *ahinfo = par->matchinfo;
 
        /* Must specify no unknown invflags */
        if (ahinfo->invflags & ~IPT_AH_INV_MASK) {
@@ -83,7 +75,7 @@ ah_mt_check(const char *tablename, const void *ip_void,
 
 static struct xt_match ah_mt_reg __read_mostly = {
        .name           = "ah",
-       .family         = AF_INET,
+       .family         = NFPROTO_IPV4,
        .match          = ah_mt,
        .matchsize      = sizeof(struct ipt_ah),
        .proto          = IPPROTO_AH,