Commit ad6d9503 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nf_ct_helper: define pr_fmt()

Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 39e6dea2
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/netfilter.h> #include <linux/netfilter.h>
...@@ -505,11 +507,11 @@ static int help(struct sk_buff *skb, ...@@ -505,11 +507,11 @@ static int help(struct sk_buff *skb,
different IP address. Simply don't record it for different IP address. Simply don't record it for
NAT. */ NAT. */
if (cmd.l3num == PF_INET) { if (cmd.l3num == PF_INET) {
pr_debug("conntrack_ftp: NOT RECORDING: %pI4 != %pI4\n", pr_debug("NOT RECORDING: %pI4 != %pI4\n",
&cmd.u3.ip, &cmd.u3.ip,
&ct->tuplehash[dir].tuple.src.u3.ip); &ct->tuplehash[dir].tuple.src.u3.ip);
} else { } else {
pr_debug("conntrack_ftp: NOT RECORDING: %pI6 != %pI6\n", pr_debug("NOT RECORDING: %pI6 != %pI6\n",
cmd.u3.ip6, cmd.u3.ip6,
ct->tuplehash[dir].tuple.src.u3.ip6); ct->tuplehash[dir].tuple.src.u3.ip6);
} }
...@@ -586,8 +588,7 @@ static void nf_conntrack_ftp_fini(void) ...@@ -586,8 +588,7 @@ static void nf_conntrack_ftp_fini(void)
if (ftp[i][j].me == NULL) if (ftp[i][j].me == NULL)
continue; continue;
pr_debug("nf_ct_ftp: unregistering helper for pf: %d " pr_debug("unregistering helper for pf: %d port: %d\n",
"port: %d\n",
ftp[i][j].tuple.src.l3num, ports[i]); ftp[i][j].tuple.src.l3num, ports[i]);
nf_conntrack_helper_unregister(&ftp[i][j]); nf_conntrack_helper_unregister(&ftp[i][j]);
} }
...@@ -625,14 +626,12 @@ static int __init nf_conntrack_ftp_init(void) ...@@ -625,14 +626,12 @@ static int __init nf_conntrack_ftp_init(void)
else else
sprintf(ftp[i][j].name, "ftp-%d", ports[i]); sprintf(ftp[i][j].name, "ftp-%d", ports[i]);
pr_debug("nf_ct_ftp: registering helper for pf: %d " pr_debug("registering helper for pf: %d port: %d\n",
"port: %d\n",
ftp[i][j].tuple.src.l3num, ports[i]); ftp[i][j].tuple.src.l3num, ports[i]);
ret = nf_conntrack_helper_register(&ftp[i][j]); ret = nf_conntrack_helper_register(&ftp[i][j]);
if (ret) { if (ret) {
printk(KERN_ERR "nf_ct_ftp: failed to register" pr_err("failed to register helper for pf: %d port: %d\n",
" helper for pf: %d port: %d\n", ftp[i][j].tuple.src.l3num, ports[i]);
ftp[i][j].tuple.src.l3num, ports[i]);
nf_conntrack_ftp_fini(); nf_conntrack_ftp_fini();
return ret; return ret;
} }
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
...@@ -237,7 +239,7 @@ static int __init nf_conntrack_irc_init(void) ...@@ -237,7 +239,7 @@ static int __init nf_conntrack_irc_init(void)
int i, ret; int i, ret;
if (max_dcc_channels < 1) { if (max_dcc_channels < 1) {
printk(KERN_ERR "nf_ct_irc: max_dcc_channels must not be zero\n"); pr_err("max_dcc_channels must not be zero\n");
return -EINVAL; return -EINVAL;
} }
...@@ -267,8 +269,7 @@ static int __init nf_conntrack_irc_init(void) ...@@ -267,8 +269,7 @@ static int __init nf_conntrack_irc_init(void)
ret = nf_conntrack_helper_register(&irc[i]); ret = nf_conntrack_helper_register(&irc[i]);
if (ret) { if (ret) {
printk(KERN_ERR "nf_ct_irc: failed to register helper " pr_err("failed to register helper for pf: %u port: %u\n",
"for pf: %u port: %u\n",
irc[i].tuple.src.l3num, ports[i]); irc[i].tuple.src.l3num, ports[i]);
nf_conntrack_irc_fini(); nf_conntrack_irc_fini();
return ret; return ret;
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/netfilter.h> #include <linux/netfilter.h>
...@@ -120,14 +122,14 @@ static int help(struct sk_buff *skb, ...@@ -120,14 +122,14 @@ static int help(struct sk_buff *skb,
ct_sane_info->state = SANE_STATE_NORMAL; ct_sane_info->state = SANE_STATE_NORMAL;
if (datalen < sizeof(struct sane_reply_net_start)) { if (datalen < sizeof(struct sane_reply_net_start)) {
pr_debug("nf_ct_sane: NET_START reply too short\n"); pr_debug("NET_START reply too short\n");
goto out; goto out;
} }
reply = sb_ptr; reply = sb_ptr;
if (reply->status != htonl(SANE_STATUS_SUCCESS)) { if (reply->status != htonl(SANE_STATUS_SUCCESS)) {
/* saned refused the command */ /* saned refused the command */
pr_debug("nf_ct_sane: unsuccessful SANE_STATUS = %u\n", pr_debug("unsuccessful SANE_STATUS = %u\n",
ntohl(reply->status)); ntohl(reply->status));
goto out; goto out;
} }
...@@ -148,7 +150,7 @@ static int help(struct sk_buff *skb, ...@@ -148,7 +150,7 @@ static int help(struct sk_buff *skb,
&tuple->src.u3, &tuple->dst.u3, &tuple->src.u3, &tuple->dst.u3,
IPPROTO_TCP, NULL, &reply->port); IPPROTO_TCP, NULL, &reply->port);
pr_debug("nf_ct_sane: expect: "); pr_debug("expect: ");
nf_ct_dump_tuple(&exp->tuple); nf_ct_dump_tuple(&exp->tuple);
/* Can't expect this? Best to drop packet now. */ /* Can't expect this? Best to drop packet now. */
...@@ -178,8 +180,7 @@ static void nf_conntrack_sane_fini(void) ...@@ -178,8 +180,7 @@ static void nf_conntrack_sane_fini(void)
for (i = 0; i < ports_c; i++) { for (i = 0; i < ports_c; i++) {
for (j = 0; j < 2; j++) { for (j = 0; j < 2; j++) {
pr_debug("nf_ct_sane: unregistering helper for pf: %d " pr_debug("unregistering helper for pf: %d port: %d\n",
"port: %d\n",
sane[i][j].tuple.src.l3num, ports[i]); sane[i][j].tuple.src.l3num, ports[i]);
nf_conntrack_helper_unregister(&sane[i][j]); nf_conntrack_helper_unregister(&sane[i][j]);
} }
...@@ -216,14 +217,12 @@ static int __init nf_conntrack_sane_init(void) ...@@ -216,14 +217,12 @@ static int __init nf_conntrack_sane_init(void)
else else
sprintf(sane[i][j].name, "sane-%d", ports[i]); sprintf(sane[i][j].name, "sane-%d", ports[i]);
pr_debug("nf_ct_sane: registering helper for pf: %d " pr_debug("registering helper for pf: %d port: %d\n",
"port: %d\n",
sane[i][j].tuple.src.l3num, ports[i]); sane[i][j].tuple.src.l3num, ports[i]);
ret = nf_conntrack_helper_register(&sane[i][j]); ret = nf_conntrack_helper_register(&sane[i][j]);
if (ret) { if (ret) {
printk(KERN_ERR "nf_ct_sane: failed to " pr_err("failed to register helper for pf: %d port: %d\n",
"register helper for pf: %d port: %d\n", sane[i][j].tuple.src.l3num, ports[i]);
sane[i][j].tuple.src.l3num, ports[i]);
nf_conntrack_sane_fini(); nf_conntrack_sane_fini();
return ret; return ret;
} }
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
...@@ -1665,8 +1667,7 @@ static int __init nf_conntrack_sip_init(void) ...@@ -1665,8 +1667,7 @@ static int __init nf_conntrack_sip_init(void)
ret = nf_conntrack_helper_register(&sip[i][j]); ret = nf_conntrack_helper_register(&sip[i][j]);
if (ret) { if (ret) {
printk(KERN_ERR "nf_ct_sip: failed to register" pr_err("failed to register helper for pf: %u port: %u\n",
" helper for pf: %u port: %u\n",
sip[i][j].tuple.src.l3num, ports[i]); sip[i][j].tuple.src.l3num, ports[i]);
nf_conntrack_sip_fini(); nf_conntrack_sip_fini();
return ret; return ret;
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/in.h> #include <linux/in.h>
...@@ -138,9 +140,8 @@ static int __init nf_conntrack_tftp_init(void) ...@@ -138,9 +140,8 @@ static int __init nf_conntrack_tftp_init(void)
ret = nf_conntrack_helper_register(&tftp[i][j]); ret = nf_conntrack_helper_register(&tftp[i][j]);
if (ret) { if (ret) {
printk(KERN_ERR "nf_ct_tftp: failed to register" pr_err("failed to register helper for pf: %u port: %u\n",
" helper for pf: %u port: %u\n", tftp[i][j].tuple.src.l3num, ports[i]);
tftp[i][j].tuple.src.l3num, ports[i]);
nf_conntrack_tftp_fini(); nf_conntrack_tftp_fini();
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment