]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/ipt_ULOG.c
Merge branch 'linus' into x86/quirks
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / ipt_ULOG.c
index 4139042a63a11ab225f20eb1f6736eb86fb5a4e1..18a2826b57c6f2c7e16cd2c091ca68db772b61f6 100644 (file)
 #include <linux/netfilter.h>
 #include <linux/netfilter/x_tables.h>
 #include <linux/netfilter_ipv4/ipt_ULOG.h>
+#include <net/netfilter/nf_log.h>
 #include <net/sock.h>
 #include <linux/bitops.h>
 #include <asm/unaligned.h>
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
-MODULE_DESCRIPTION("iptables userspace logging module");
+MODULE_DESCRIPTION("Xtables: packet logging to netlink using ULOG");
 MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_NFLOG);
 
 #define ULOG_NL_EVENT          111             /* Harald's favorite number */
@@ -280,18 +281,14 @@ alloc_failure:
 }
 
 static unsigned int
-ulog_tg(struct sk_buff *skb, const struct net_device *in,
-        const struct net_device *out, unsigned int hooknum,
-        const struct xt_target *target, const void *targinfo)
+ulog_tg(struct sk_buff *skb, const struct xt_target_param *par)
 {
-       struct ipt_ulog_info *loginfo = (struct ipt_ulog_info *) targinfo;
-
-       ipt_ulog_packet(hooknum, skb, in, out, loginfo, NULL);
-
+       ipt_ulog_packet(par->hooknum, skb, par->in, par->out,
+                       par->targinfo, NULL);
        return XT_CONTINUE;
 }
 
-static void ipt_logfn(unsigned int pf,
+static void ipt_logfn(u_int8_t pf,
                      unsigned int hooknum,
                      const struct sk_buff *skb,
                      const struct net_device *in,
@@ -316,12 +313,9 @@ static void ipt_logfn(unsigned int pf,
        ipt_ulog_packet(hooknum, skb, in, out, &loginfo, prefix);
 }
 
-static bool
-ulog_tg_check(const char *tablename, const void *e,
-              const struct xt_target *target, void *targinfo,
-              unsigned int hookmask)
+static bool ulog_tg_check(const struct xt_tgchk_param *par)
 {
-       const struct ipt_ulog_info *loginfo = targinfo;
+       const struct ipt_ulog_info *loginfo = par->targinfo;
 
        if (loginfo->prefix[sizeof(loginfo->prefix) - 1] != '\0') {
                pr_debug("ipt_ULOG: prefix term %i\n",
@@ -373,7 +367,7 @@ static int ulog_tg_compat_to_user(void __user *dst, void *src)
 
 static struct xt_target ulog_tg_reg __read_mostly = {
        .name           = "ULOG",
-       .family         = AF_INET,
+       .family         = NFPROTO_IPV4,
        .target         = ulog_tg,
        .targetsize     = sizeof(struct ipt_ulog_info),
        .checkentry     = ulog_tg_check,
@@ -414,11 +408,11 @@ static int __init ulog_tg_init(void)
 
        ret = xt_register_target(&ulog_tg_reg);
        if (ret < 0) {
-               sock_release(nflognl->sk_socket);
+               netlink_kernel_release(nflognl);
                return ret;
        }
        if (nflog)
-               nf_log_register(PF_INET, &ipt_ulog_logger);
+               nf_log_register(NFPROTO_IPV4, &ipt_ulog_logger);
 
        return 0;
 }
@@ -433,7 +427,7 @@ static void __exit ulog_tg_exit(void)
        if (nflog)
                nf_log_unregister(&ipt_ulog_logger);
        xt_unregister_target(&ulog_tg_reg);
-       sock_release(nflognl->sk_socket);
+       netlink_kernel_release(nflognl);
 
        /* remove pending timers and free allocated skb's */
        for (i = 0; i < ULOG_MAXNLGROUPS; i++) {