RxRPC: Error handling for rxrpc_alloc_connection()
[safe/jmp/linux-2.6] / net / bridge / netfilter / ebt_ip.c
index 018782f..d771bbf 100644 (file)
@@ -24,12 +24,10 @@ struct tcpudphdr {
        __be16 dst;
 };
 
-static bool ebt_filter_ip(const struct sk_buff *skb,
-   const struct net_device *in,
-   const struct net_device *out, const void *data,
-   unsigned int datalen)
+static bool
+ebt_ip_mt(const struct sk_buff *skb, const struct xt_match_param *par)
 {
-       const struct ebt_ip_info *info = data;
+       const struct ebt_ip_info *info = par->matchinfo;
        const struct iphdr *ih;
        struct iphdr _iph;
        const struct tcpudphdr *pptr;
@@ -79,10 +77,10 @@ static bool ebt_filter_ip(const struct sk_buff *skb,
        return true;
 }
 
-static bool ebt_ip_check(const char *tablename, unsigned int hookmask,
-   const struct ebt_entry *e, void *data, unsigned int datalen)
+static bool ebt_ip_mt_check(const struct xt_mtchk_param *par)
 {
-       const struct ebt_ip_info *info = data;
+       const struct ebt_ip_info *info = par->matchinfo;
+       const struct ebt_entry *e = par->entryinfo;
 
        if (e->ethproto != htons(ETH_P_IP) ||
           e->invflags & EBT_IPROTO)
@@ -106,22 +104,24 @@ static bool ebt_ip_check(const char *tablename, unsigned int hookmask,
        return true;
 }
 
-static struct ebt_match filter_ip __read_mostly = {
-       .name           = EBT_IP_MATCH,
-       .match          = ebt_filter_ip,
-       .check          = ebt_ip_check,
+static struct xt_match ebt_ip_mt_reg __read_mostly = {
+       .name           = "ip",
+       .revision       = 0,
+       .family         = NFPROTO_BRIDGE,
+       .match          = ebt_ip_mt,
+       .checkentry     = ebt_ip_mt_check,
        .matchsize      = XT_ALIGN(sizeof(struct ebt_ip_info)),
        .me             = THIS_MODULE,
 };
 
 static int __init ebt_ip_init(void)
 {
-       return ebt_register_match(&filter_ip);
+       return xt_register_match(&ebt_ip_mt_reg);
 }
 
 static void __exit ebt_ip_fini(void)
 {
-       ebt_unregister_match(&filter_ip);
+       xt_unregister_match(&ebt_ip_mt_reg);
 }
 
 module_init(ebt_ip_init);