|
@@ -13,7 +13,6 @@
|
|
#include <linux/netfilter/x_tables.h>
|
|
#include <linux/netfilter/x_tables.h>
|
|
#include <linux/netfilter/xt_NFLOG.h>
|
|
#include <linux/netfilter/xt_NFLOG.h>
|
|
#include <net/netfilter/nf_log.h>
|
|
#include <net/netfilter/nf_log.h>
|
|
-#include <net/netfilter/nfnetlink_log.h>
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
|
|
MODULE_AUTHOR("Patrick McHardy <kaber@trash.net>");
|
|
MODULE_DESCRIPTION("Xtables: packet logging to netlink using NFLOG");
|
|
MODULE_DESCRIPTION("Xtables: packet logging to netlink using NFLOG");
|
|
@@ -37,8 +36,9 @@ nflog_tg(struct sk_buff *skb, const struct xt_action_param *par)
|
|
if (info->flags & XT_NFLOG_F_COPY_LEN)
|
|
if (info->flags & XT_NFLOG_F_COPY_LEN)
|
|
li.u.ulog.flags |= NF_LOG_F_COPY_LEN;
|
|
li.u.ulog.flags |= NF_LOG_F_COPY_LEN;
|
|
|
|
|
|
- nfulnl_log_packet(net, xt_family(par), xt_hooknum(par), skb,
|
|
|
|
- xt_in(par), xt_out(par), &li, info->prefix);
|
|
|
|
|
|
+ nf_log_packet(net, xt_family(par), xt_hooknum(par), skb, xt_in(par),
|
|
|
|
+ xt_out(par), &li, "%s", info->prefix);
|
|
|
|
+
|
|
return XT_CONTINUE;
|
|
return XT_CONTINUE;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -50,7 +50,13 @@ static int nflog_tg_check(const struct xt_tgchk_param *par)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
if (info->prefix[sizeof(info->prefix) - 1] != '\0')
|
|
if (info->prefix[sizeof(info->prefix) - 1] != '\0')
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
- return 0;
|
|
|
|
|
|
+
|
|
|
|
+ return nf_logger_find_get(par->family, NF_LOG_TYPE_ULOG);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void nflog_tg_destroy(const struct xt_tgdtor_param *par)
|
|
|
|
+{
|
|
|
|
+ nf_logger_put(par->family, NF_LOG_TYPE_ULOG);
|
|
}
|
|
}
|
|
|
|
|
|
static struct xt_target nflog_tg_reg __read_mostly = {
|
|
static struct xt_target nflog_tg_reg __read_mostly = {
|
|
@@ -58,6 +64,7 @@ static struct xt_target nflog_tg_reg __read_mostly = {
|
|
.revision = 0,
|
|
.revision = 0,
|
|
.family = NFPROTO_UNSPEC,
|
|
.family = NFPROTO_UNSPEC,
|
|
.checkentry = nflog_tg_check,
|
|
.checkentry = nflog_tg_check,
|
|
|
|
+ .destroy = nflog_tg_destroy,
|
|
.target = nflog_tg,
|
|
.target = nflog_tg,
|
|
.targetsize = sizeof(struct xt_nflog_info),
|
|
.targetsize = sizeof(struct xt_nflog_info),
|
|
.me = THIS_MODULE,
|
|
.me = THIS_MODULE,
|