netfilter: {ipt,ebt}_ULOG: rise warning on deprecation
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 22 May 2013 22:42:37 +0000 (22:42 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 23 May 2013 12:23:16 +0000 (14:23 +0200)
This target has been superseded by NFLOG. Spot a warning
so we prepare removal in a couple of years.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Gao feng <gaofeng@cn.fujitsu.com>
include/net/netns/x_tables.h
net/bridge/netfilter/ebt_ulog.c
net/ipv4/netfilter/Kconfig
net/ipv4/netfilter/ipt_ULOG.c

index c24060ee411e9e15a91a0fc5bd189eef8425869b..02fe40f8c8fda4a1351cf8079b083d5220234274 100644 (file)
@@ -15,5 +15,11 @@ struct netns_xt {
        struct ebt_table *frame_filter;
        struct ebt_table *frame_nat;
 #endif
+#if IS_ENABLED(CONFIG_IP_NF_TARGET_ULOG)
+       bool ulog_warn_deprecated;
+#endif
+#if IS_ENABLED(CONFIG_BRIDGE_EBT_ULOG)
+       bool ebt_ulog_warn_deprecated;
+#endif
 };
 #endif
index fc1905c514178a1ae439060588e06a7c5d26e446..2ec6c19ff9034f48d9da1108fcc34aa0f7c1ee2c 100644 (file)
@@ -267,6 +267,12 @@ static int ebt_ulog_tg_check(const struct xt_tgchk_param *par)
 {
        struct ebt_ulog_info *uloginfo = par->targinfo;
 
+       if (!par->net->xt.ebt_ulog_warn_deprecated) {
+               pr_info("ebt_ulog is deprecated and it will be removed soon, "
+                       "use ebt_nflog instead\n");
+               par->net->xt.ebt_ulog_warn_deprecated = true;
+       }
+
        if (uloginfo->nlgroup > 31)
                return -EINVAL;
 
index e7916c193932222b7538c104dc71eeb8b3f8b5f2..4e9028017428405ef2005f7558406c5ba3086a24 100644 (file)
@@ -111,7 +111,7 @@ config IP_NF_TARGET_REJECT
          To compile it as a module, choose M here.  If unsure, say N.
 
 config IP_NF_TARGET_ULOG
-       tristate "ULOG target support"
+       tristate "ULOG target support (obsolete)"
        default m if NETFILTER_ADVANCED=n
        ---help---
 
index f8a222cb64481c95e2f3b53207e3c6a3d372f4d2..c1953d07e2f495020da433ddc2492cd5be0ffde1 100644 (file)
@@ -325,6 +325,12 @@ static int ulog_tg_check(const struct xt_tgchk_param *par)
 {
        const struct ipt_ulog_info *loginfo = par->targinfo;
 
+       if (!par->net->xt.ulog_warn_deprecated) {
+               pr_info("ULOG is deprecated and it will be removed soon, "
+                       "use NFLOG instead\n");
+               par->net->xt.ulog_warn_deprecated = true;
+       }
+
        if (loginfo->prefix[sizeof(loginfo->prefix) - 1] != '\0') {
                pr_debug("prefix not null-terminated\n");
                return -EINVAL;