net: netfilter: Replace printk() with more standardize output format.
Subsystems (2)
PATCH 1/1 net: netfilter: Replace printk() with more standardize output format.
printk() is the raw way to print output and should be avoided.
For drivers with defined "struct device object", dev_*macro() is prefer and for "struct netdevice object", netdev_*macro() is prefer over dev_*macro() to standardize the output format within the subsystem.
If no "struct device object" is defined prefer pr_*macro() over printk().
This patch Replace printk having a log level with the appropriate output format according to the order of preference.
--- net/netfilter/nf_conntrack_acct.c | 2 +- net/netfilter/nf_conntrack_ecache.c | 2 +- net/netfilter/nf_conntrack_timestamp.c | 2 +- net/netfilter/nf_nat_core.c | 2 +- net/netfilter/nfnetlink_queue.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-)
net/netfilter/nf_conntrack_acct.c +1 -1
@@ -80,7 +80,7 @@ static int nf_conntrack_acct_init_sysctl(struct net *net) net->ct.acct_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.acct_sysctl_header) { -printk (KERN_ERR "nf_conntrack_acct: can't register to sysctl.\n" ); +netdev_err (net->loopback_dev,"nf_conntrack_acct: can't register to sysctl.\n" ); goto out_register; }return 0 ;
net/netfilter/nf_conntrack_ecache.c +1 -1
@@ -372,7 +372,7 @@ static int nf_conntrack_event_init_sysctl(struct net *net) net->ct.event_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.event_sysctl_header) { -printk (KERN_ERR "nf_ct_event: can't register to sysctl.\n" ); +netdev_err (net->loopback_dev,"nf_ct_event: can't register to sysctl.\n" ); goto out_register; }return 0 ;
net/netfilter/nf_conntrack_timestamp.c +1 -1
@@ -58,7 +58,7 @@ static int nf_conntrack_tstamp_init_sysctl(struct net *net) net->ct.tstamp_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.tstamp_sysctl_header) { -printk (KERN_ERR "nf_ct_tstamp: can't register to sysctl.\n" ); +netdev_err (net->loopback_dev,"nf_ct_tstamp: can't register to sysctl.\n" ); goto out_register; }return 0 ;
net/netfilter/nf_nat_core.c +1 -1
@@ -814,7 +814,7 @@ static int __init nf_nat_init(void) ret =nf_ct_extend_register (&nat_extend);if (ret <0 ) {nf_ct_free_hashtable (nf_nat_bysource, nf_nat_htable_size); -printk (KERN_ERR "nf_nat_core: Unable to register extension\n" ); +pr_err ("nf_nat_core: Unable to register extension\n" );return ret; }
net/netfilter/nfnetlink_queue.c +2 -2
@@ -834,8 +834,8 @@ nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e, int diff) nskb =skb_copy_expand (e->skb,skb_headroom (e->skb), diff,GFP_ATOMIC );if (!nskb) { -printk (KERN_WARNING "nf_queue: OOM " -"in mangle, dropping packet\n" ); +netdev_warn (nskb->dev,"nf_queue: OOM " +"in mangle, dropping packet\n" );return -ENOMEM ; }kfree_skb (e->skb);
Signature · 1 line
2.7.4
Pablo Neira Ayuso
maintainerQuoted 26 lines · Arushi Singhal
printk()is the raw way to print output and should be avoided.For drivers with defined "struct device object", dev_*macro() is prefer and for "struct netdevice object", netdev_*macro() is prefer over dev_*macro() to standardize the output format within the subsystem.
If no "struct device object" is defined prefer pr_*macro() over
printk().This patch Replace printk having a log level with the appropriate output format according to the order of preference.
Signed-off-by Arushi Singhal <[email protected]>--- net/netfilter/nf_conntrack_acct.c | 2 +- net/netfilter/nf_conntrack_ecache.c | 2 +- net/netfilter/nf_conntrack_timestamp.c | 2 +- net/netfilter/nf_nat_core.c | 2 +- net/netfilter/nfnetlink_queue.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-)net/netfilter/nf_conntrack_acct.c +0
-0
net/netfilter/nf_conntrack_acct.c static int nf_conntrack_acct_init_sysctl(struct net *net) · line 83
Quoted 5 lines
net/netfilter/nf_conntrack_acct.c +1
-1@@ -80,7 +80,7 @@ static int nf_conntrack_acct_init_sysctl(struct net *net) net->ct.acct_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.acct_sysctl_header) { -printk (KERN_ERR "nf_conntrack_acct: can't register to sysctl.\n" ); +netdev_err (net->loopback_dev,"nf_conntrack_acct: can't register to sysctl.\n" );
Please, use pr_err instead.
And while you are at it, add
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
whenever possible, thanks!
P.S: Send your netfilter patches to [email protected].
Quoted 60 lines
net/netfilter/nf_conntrack_acct.c +0
-0goto out_register; }return 0 ;net/netfilter/nf_conntrack_ecache.c +1
-1@@ -372,7 +372,7 @@ static int nf_conntrack_event_init_sysctl(struct net *net) net->ct.event_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.event_sysctl_header) { -printk (KERN_ERR "nf_ct_event: can't register to sysctl.\n" ); +netdev_err (net->loopback_dev,"nf_ct_event: can't register to sysctl.\n" ); goto out_register; }return 0 ;net/netfilter/nf_conntrack_timestamp.c +1
-1@@ -58,7 +58,7 @@ static int nf_conntrack_tstamp_init_sysctl(struct net *net) net->ct.tstamp_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.tstamp_sysctl_header) { -printk (KERN_ERR "nf_ct_tstamp: can't register to sysctl.\n" ); +netdev_err (net->loopback_dev,"nf_ct_tstamp: can't register to sysctl.\n" ); goto out_register; }return 0 ;net/netfilter/nf_nat_core.c +1
-1@@ -814,7 +814,7 @@ static int __init nf_nat_init(void) ret =nf_ct_extend_register (&nat_extend);if (ret <0 ) {nf_ct_free_hashtable (nf_nat_bysource, nf_nat_htable_size); -printk (KERN_ERR "nf_nat_core: Unable to register extension\n" ); +pr_err ("nf_nat_core: Unable to register extension\n" );return ret; }net/netfilter/nfnetlink_queue.c +2
-2@@ -834,8 +834,8 @@ nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e, int diff) nskb =skb_copy_expand (e->skb,skb_headroom (e->skb), diff,GFP_ATOMIC );if (!nskb) { -printk (KERN_WARNING "nf_queue: OOM " -"in mangle, dropping packet\n" ); +netdev_warn (nskb->dev,"nf_queue: OOM " +"in mangle, dropping packet\n" );return -ENOMEM ; }kfree_skb (e->skb);Signature · 1 line
2.7.4
Quoted 40 lines · Pablo Neira Ayuso
Quoted 21 lines · Arushi Singhal
printk()is the raw way to print output and should be avoided.For drivers with defined "struct device object", dev_*macro() is prefer and for "struct netdevice object", netdev_*macro() is prefer over dev_*macro() to standardize the output format within the subsystem.
If no "struct device object" is defined prefer pr_*macro() over
printk().This patch Replace printk having a log level with the appropriate output format according to the order of preference.
Signed-off-by Arushi Singhal <[email protected]>--- net/netfilter/nf_conntrack_acct.c | 2 +- net/netfilter/nf_conntrack_ecache.c | 2 +- net/netfilter/nf_conntrack_timestamp.c | 2 +- net/netfilter/nf_nat_core.c | 2 +- net/netfilter/nfnetlink_queue.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-)Review
Quoted 1 line
(quoted diff) +0
-0
b/net/netfilter/nf_conntrack_acct.cnet/netfilter/nf_conntrack_acct.c static int nf_conntrack_acct_init_sysctl(struct net
Quoted 4 lines
index 8669167..fc7329d 100644
net/netfilter/nf_conntrack_acct.c +0
-0@@ -80,7 +80,7 @@ static int nf_conntrack_acct_init_sysctl(struct net*net)
net/netfilter/nf_conntrack_acct.c static int nf_conntrack_acct_init_sysctl(struct net · line 80
Quoted 1 line
net/netfilter/nf_conntrack_acct.c +0
-0net->ct.acct_sysctl_header = register_net_sysctl(net,"net/netfilter",
net/netfilter/nf_conntrack_acct.c static int nf_conntrack_acct_init_sysctl(struct net *net)
Quoted 3 lines
net/netfilter/nf_conntrack_acct.c +0
-1table);if (!net->ct.acct_sysctl_header) { - printk(KERN_ERR "nf_conntrack_acct: can't register tosysctl.\n");
net/netfilter/nf_conntrack_acct.c static int nf_conntrack_acct_init_sysctl(struct net · line 83
Quoted 1 line
net/netfilter/nf_conntrack_acct.c +1
-0+ netdev_err(net->loopback_dev, "nf_conntrack_acct: can'tregister to sysctl.\n");
Please, use
pr_errinstead.
Quoted 8 lines
And while you are at it, add
#define
pr_fmt(fmt)KBUILD_MODNAME": " fmtwhenever possible, thanks!
P.S: Send your netfilter patches to [email protected].
Hello Pablo
I''ll resend the patch according your suggestions.
Just for curiosity wanted to ask why not netdev_*().
Arushi
Quoted 76 lines
Review
Quoted 5 lines
net/netfilter/nf_conntrack_acct.c +0
-0goto out_register; }return 0 ;(quoted diff) +0
-0
b/net/netfilter/nf_conntrack_ecache.cnet/netfilter/nf_conntrack_ecache.c static int nf_conntrack_event_init_sysctl(struct
Quoted 4 lines
index caac41a..c1fb296 100644
net/netfilter/nf_conntrack_ecache.c +0
-0@@ -372,7 +372,7 @@ static int nf_conntrack_event_init_sysctl(structnet *net)
net/netfilter/nf_conntrack_ecache.c static int nf_conntrack_event_init_sysctl(struct net *net)
Quoted 4 lines
net/netfilter/nf_conntrack_ecache.c +0
-1net->ct.event_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.event_sysctl_header) { - printk(KERN_ERR "nf_ct_event: can't register tosysctl.\n");
net/netfilter/nf_conntrack_ecache.c static int nf_conntrack_event_init_sysctl(struct · line 375
Quoted 1 line
net/netfilter/nf_conntrack_ecache.c +1
-0+ netdev_err(net->loopback_dev, "nf_ct_event: can't registerto sysctl.\n");
Review
Quoted 4 lines
net/netfilter/nf_conntrack_ecache.c +0
-0goto out_register; }return 0 ;(quoted diff) +0
-0
b/net/netfilter/nf_conntrack_timestamp.cnet/netfilter/nf_conntrack_timestamp.c static int nf_conntrack_tstamp_init_sysctl(struct net
Quoted 4 lines
index 4c4734b..abd9fbd 100644
net/netfilter/nf_conntrack_timestamp.c +0
-0@@ -58,7 +58,7 @@ static int nf_conntrack_tstamp_init_sysctl(struct net*net)
net/netfilter/nf_conntrack_timestamp.c static int nf_conntrack_tstamp_init_sysctl(struct net · line 58
Quoted 1 line
net/netfilter/nf_conntrack_timestamp.c +0
-0net->ct.tstamp_sysctl_header = register_net_sysctl(net,"net/netfilter",
net/netfilter/nf_conntrack_timestamp.c static int nf_conntrack_tstamp_init_sysctl(struct net *net)
Quoted 3 lines
net/netfilter/nf_conntrack_timestamp.c +0
-1table);if (!net->ct.tstamp_sysctl_header) { - printk(KERN_ERR "nf_ct_tstamp: can't register tosysctl.\n");
net/netfilter/nf_conntrack_timestamp.c static int nf_conntrack_tstamp_init_sysctl(struct net · line 61
Quoted 1 line
net/netfilter/nf_conntrack_timestamp.c +1
-0+ netdev_err(net->loopback_dev, "nf_ct_tstamp: can'tregister to sysctl.\n");
net/netfilter/nf_nat_core.c static int __init nf_nat_init(void) · line 817
Quoted 12 lines
net/netfilter/nf_conntrack_timestamp.c +0
-0goto out_register; }return 0 ;net/netfilter/nf_nat_core.c +0
-1@@ -814,7 +814,7 @@ static int __init nf_nat_init(void) ret =nf_ct_extend_register (&nat_extend);if (ret <0 ) {nf_ct_free_hashtable (nf_nat_bysource, nf_nat_htable_size); - printk(KERN_ERR "nf_nat_core: Unable to registerextension\n");
net/netfilter/nfnetlink_
Quoted 5 lines
net/netfilter/nf_nat_core.c +1
-0+pr_err ("nf_nat_core: Unable to register extension\n" );return ret; }net/netfilter/nfnetlink_ renamed from net/netfilter/nfnetlink_queue.c +0
-0
queue.cnet/netfilter/nfnetlink_queue.c nfqnl_mangle(void *data, int data_len, struct
Quoted 4 lines
index 8bba231..4b4bef5 100644
net/netfilter/nfnetlink_queue.c +0
-0@@ -834,8 +834,8 @@ nfqnl_mangle(void *data, int data_len, struct
nf_queue_entry*e, int diff)net/netfilter/nfnetlink_queue.c nfqnl_mangle(void *data, int data_len, struct · line 834
Quoted 1 line
net/netfilter/nfnetlink_queue.c +0
-0nskb = skb_copy_expand(e->skb,
skb_headroom(e->skb),net/netfilter/nfnetlink_queue.c nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e, int diff)
Quoted 6 lines
net/netfilter/nfnetlink_queue.c +2
-2diff, GFP_ATOMIC); if (!nskb) { -printk (KERN_WARNING "nf_queue: OOM " -"in mangle, dropping packet\n" ); + netdev_warn(nskb->dev, "nf_queue: OOM " + "in mangle, droppingpacket\n");
Quoted 6 lines
net/netfilter/nfnetlink_queue.c +0
-1return -ENOMEM ; }kfree_skb (e->skb); --2.7.4
Florian Westphal
maintainerQuoted 3 lines · Arushi Singhal
I''ll resend the patch according your suggestions.
Just for curiosity wanted to ask why not netdev_*().
netfilter is not a network driver.
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
register_net_sysctl(net, "net/netfilter", table); if (!net->ct.event_sysctl_header) {- printk(KERN_ERR "
nf_ct_event: can't register tosysctl.\n");
Quoted 1 line
+ netdev_err(net->loopback_dev, "
nf_ct_event: can't registerto sysctl.\n");
This claims that the error is related to loopback device. Its not.
Quoted 5 lines
Quoted 5 lines
net/netfilter/nfnetlink_queue.c nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e, int diff)
Quoted 5 lines
if (!nskb) {net/netfilter/nfnetlink_queue.c +2
-2-printk (KERN_WARNING "nf_queue: OOM " -"in mangle, dropping packet\n" ); +netdev_warn (nskb->dev,"nf_queue: OOM " + "in mangle, dropping
This now points at a random network device, but again this condition doesn't have anything to do with a network device.
Quoted 11 lines · Arushi Singhal
printk()is the raw way to print output and should be avoided.For drivers with defined "struct device object", dev_*macro() is prefer and for "struct netdevice object", netdev_*macro() is prefer over dev_*macro() to standardize the output format within the subsystem.
If no "struct device object" is defined prefer pr_*macro() over
printk().This patch Replace printk having a log level with the appropriate output format according to the order of preference.
Hi Arushi,
As mentioned in the IRC chat for Outreachy applicants, please drop outreachy-kernel mailing list while sending patches to other subsystems than drivers/staging to avoid confusion.
Thank you!
Quoted 85 lines
Signed-off-by Arushi Singhal <[email protected]>--- net/netfilter/nf_conntrack_acct.c | 2 +- net/netfilter/nf_conntrack_ecache.c | 2 +- net/netfilter/nf_conntrack_timestamp.c | 2 +- net/netfilter/nf_nat_core.c | 2 +- net/netfilter/nfnetlink_queue.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-)net/netfilter/nf_conntrack_acct.c +1
-1@@ -80,7 +80,7 @@ static int nf_conntrack_acct_init_sysctl(struct net *net) net->ct.acct_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.acct_sysctl_header) { -printk (KERN_ERR "nf_conntrack_acct: can't register to sysctl.\n" ); +netdev_err (net->loopback_dev,"nf_conntrack_acct: can't register to sysctl.\n" ); goto out_register; }return 0 ;net/netfilter/nf_conntrack_ecache.c +1
-1@@ -372,7 +372,7 @@ static int nf_conntrack_event_init_sysctl(struct net *net) net->ct.event_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.event_sysctl_header) { -printk (KERN_ERR "nf_ct_event: can't register to sysctl.\n" ); +netdev_err (net->loopback_dev,"nf_ct_event: can't register to sysctl.\n" ); goto out_register; }return 0 ;net/netfilter/nf_conntrack_timestamp.c +1
-1@@ -58,7 +58,7 @@ static int nf_conntrack_tstamp_init_sysctl(struct net *net) net->ct.tstamp_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.tstamp_sysctl_header) { -printk (KERN_ERR "nf_ct_tstamp: can't register to sysctl.\n" ); +netdev_err (net->loopback_dev,"nf_ct_tstamp: can't register to sysctl.\n" ); goto out_register; }return 0 ;net/netfilter/nf_nat_core.c +1
-1@@ -814,7 +814,7 @@ static int __init nf_nat_init(void) ret =nf_ct_extend_register (&nat_extend);if (ret <0 ) {nf_ct_free_hashtable (nf_nat_bysource, nf_nat_htable_size); -printk (KERN_ERR "nf_nat_core: Unable to register extension\n" ); +pr_err ("nf_nat_core: Unable to register extension\n" );return ret; }net/netfilter/nfnetlink_queue.c +2
-3@@ -834,8 +834,8 @@ nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e, int diff) nskb =skb_copy_expand (e->skb,skb_headroom (e->skb), diff,GFP_ATOMIC );if (!nskb) { -printk (KERN_WARNING "nf_queue: OOM " -"in mangle, dropping packet\n" ); +netdev_warn (nskb->dev,"nf_queue: OOM " +"in mangle, dropping packet\n" );return -ENOMEM ; }kfree_skb (e->skb); --2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20180310183906.GA20125%40seema-Inspiron-15-3567.
For more options, visit https://groups.google.com/d/optout.
Signature · 2 lines
Vaishali http://vaishalithakkar.in/
Quoted 14 lines · Vaishali Thakkar
Quoted 11 lines · Arushi Singhal
printk()is the raw way to print output and should be avoided.For drivers with defined "struct device object", dev_*macro() is prefer and for "struct netdevice object", netdev_*macro() is prefer over dev_*macro() to standardize the output format within the subsystem.
If no "struct device object" is defined prefer pr_*macro() over
printk().This patch Replace printk having a log level with the appropriate output format according to the order of preference.
Quoted 7 lines
Hi Arushi,
As mentioned in the IRC chat for Outreachy applicants, please drop outreachy-kernel mailing list while sending patches to other subsystems than
drivers/stagingto avoid confusion.Hello Vaishali
I know, but netfilter is the part of the outreachy project.
Want to clarify if project patches need to be send on kernel mailing list or not?
Arushi
Quoted 117 lines
Thank you!
Review
Quoted 10 lines
Signed-off-by Arushi Singhal <[email protected]>--- net/netfilter/nf_conntrack_acct.c | 2 +- net/netfilter/nf_conntrack_ecache.c | 2 +- net/netfilter/nf_conntrack_timestamp.c | 2 +- net/netfilter/nf_nat_core.c | 2 +- net/netfilter/nfnetlink_queue.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-)(quoted diff) +0
-0
b/net/netfilter/nf_conntrack_acct.cnet/netfilter/nf_conntrack_acct.c static int nf_conntrack_acct_init_sysctl(struct net
Quoted 4 lines
index 8669167..fc7329d 100644
net/netfilter/nf_conntrack_acct.c +0
-0@@ -80,7 +80,7 @@ static int nf_conntrack_acct_init_sysctl(struct net*net)
net/netfilter/nf_conntrack_acct.c static int nf_conntrack_acct_init_sysctl(struct net · line 80
Quoted 1 line
net/netfilter/nf_conntrack_acct.c +0
-0net->ct.acct_sysctl_header = register_net_sysctl(net,"net/netfilter",
net/netfilter/nf_conntrack_acct.c static int nf_conntrack_acct_init_sysctl(struct net *net)
Quoted 3 lines
net/netfilter/nf_conntrack_acct.c +0
-1table);if (!net->ct.acct_sysctl_header) { - printk(KERN_ERR "nf_conntrack_acct: can't register tosysctl.\n");
net/netfilter/nf_conntrack_acct.c static int nf_conntrack_acct_init_sysctl(struct net · line 83
Quoted 1 line
net/netfilter/nf_conntrack_acct.c +1
-0+ netdev_err(net->loopback_dev, "nf_conntrack_acct: can'tregister to sysctl.\n");
Review
Quoted 4 lines
net/netfilter/nf_conntrack_acct.c +0
-0goto out_register; }return 0 ;(quoted diff) +0
-0
b/net/netfilter/nf_conntrack_ecache.cnet/netfilter/nf_conntrack_ecache.c static int nf_conntrack_event_init_sysctl(struct
Quoted 4 lines
index caac41a..c1fb296 100644
net/netfilter/nf_conntrack_ecache.c +0
-0@@ -372,7 +372,7 @@ static int nf_conntrack_event_init_sysctl(structnet *net)
net/netfilter/nf_conntrack_ecache.c static int nf_conntrack_event_init_sysctl(struct net *net)
Quoted 4 lines
net/netfilter/nf_conntrack_ecache.c +0
-1net->ct.event_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.event_sysctl_header) { - printk(KERN_ERR "nf_ct_event: can't register tosysctl.\n");
net/netfilter/nf_conntrack_ecache.c static int nf_conntrack_event_init_sysctl(struct · line 375
Quoted 1 line
net/netfilter/nf_conntrack_ecache.c +1
-0+ netdev_err(net->loopback_dev, "nf_ct_event: can'tregister to sysctl.\n");
Review
Quoted 4 lines
net/netfilter/nf_conntrack_ecache.c +0
-0goto out_register; }return 0 ;(quoted diff) +0
-0
b/net/netfilter/nf_conntrack_timestamp.cnet/netfilter/nf_conntrack_timestamp.c static int nf_conntrack_tstamp_init_sysctl(struct net
Quoted 4 lines
index 4c4734b..abd9fbd 100644
net/netfilter/nf_conntrack_timestamp.c +0
-0@@ -58,7 +58,7 @@ static int nf_conntrack_tstamp_init_sysctl(struct net*net)
net/netfilter/nf_conntrack_timestamp.c static int nf_conntrack_tstamp_init_sysctl(struct net · line 58
Quoted 1 line
net/netfilter/nf_conntrack_timestamp.c +0
-0net->ct.tstamp_sysctl_header = register_net_sysctl(net,"net/netfilter",
net/netfilter/nf_conntrack_timestamp.c static int nf_conntrack_tstamp_init_sysctl(struct net *net)
Quoted 3 lines
net/netfilter/nf_conntrack_timestamp.c +0
-1table);if (!net->ct.tstamp_sysctl_header) { - printk(KERN_ERR "nf_ct_tstamp: can't register tosysctl.\n");
net/netfilter/nf_conntrack_timestamp.c static int nf_conntrack_tstamp_init_sysctl(struct net · line 61
Quoted 1 line
net/netfilter/nf_conntrack_timestamp.c +1
-0+ netdev_err(net->loopback_dev, "nf_ct_tstamp: can'tregister to sysctl.\n");
net/netfilter/nf_nat_core.c static int __init nf_nat_init(void) · line 816
Quoted 11 lines
net/netfilter/nf_conntrack_timestamp.c +0
-0goto out_register; }return 0 ;net/netfilter/nf_nat_core.c +0
-0@@ -814,7 +814,7 @@ static int __init nf_nat_init(void) ret =nf_ct_extend_register (&nat_extend);if (ret <0 ) { nf_ct_free_hashtable(nf_nat_bysource,
nf_nat_htable_size);net/netfilter/nf_nat_core.c static int __init nf_nat_init(void) · line 817
Quoted 1 line
net/netfilter/nf_nat_core.c +0
-1- printk(KERN_ERR "nf_nat_core: Unable to registerextension\n");
net/netfilter/nfnetlink_
Quoted 5 lines
net/netfilter/nf_nat_core.c +1
-0+pr_err ("nf_nat_core: Unable to register extension\n" );return ret; }net/netfilter/nfnetlink_ renamed from net/netfilter/nfnetlink_queue.c +0
-0
queue.cnet/netfilter/nfnetlink_queue.c nfqnl_mangle(void *data, int data_len, struct
Quoted 4 lines
index 8bba231..4b4bef5 100644
net/netfilter/nfnetlink_queue.c +0
-0@@ -834,8 +834,8 @@ nfqnl_mangle(void *data, int data_len, struct
nf_queue_entry*e, int diff)net/netfilter/nfnetlink_queue.c nfqnl_mangle(void *data, int data_len, struct · line 834
Quoted 1 line
net/netfilter/nfnetlink_queue.c +0
-0nskb = skb_copy_expand(e->skb,
skb_headroom(e->skb),net/netfilter/nfnetlink_queue.c nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e, int diff)
Quoted 6 lines
net/netfilter/nfnetlink_queue.c +2
-2diff, GFP_ATOMIC); if (!nskb) { -printk (KERN_WARNING "nf_queue: OOM " -"in mangle, dropping packet\n" ); + netdev_warn(nskb->dev, "nf_queue: OOM " + "in mangle, droppingpacket\n");
Quoted 8 lines
net/netfilter/nfnetlink_queue.c +0
-1return -ENOMEM ; }kfree_skb (e->skb); --2.7.4
--
You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 2 lines
To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/
msgid/outreachy-kernel/20180310183906.GA20125%40seema-Inspiron-15-3567.
Quoted 1 line
For more options, visit https://groups.google.com/d/optout.
--
Vaishali
http://vaishalithakkar.in/
Quoted 25 lines · Arushi Singhal
Quoted 12 lines · Vaishali Thakkar
Quoted 9 lines · Arushi Singhal
printk()is the raw way to print output and should be avoided.For drivers with defined "struct device object", dev_*macro() is prefer and for "struct netdevice object", netdev_*macro() is prefer over dev_*macro() to standardize the output format within the subsystem.
If no "struct device object" is defined prefer pr_*macro() over
printk().Quoted 9 lines
Quoted 2 lines
This patch Replace printk having a log level with the appropriate output format according to the order of preference.
Hi Arushi,
As mentioned in the IRC chat for Outreachy applicants, please drop outreachy-kernel mailing list while sending patches to other subsystems than
drivers/stagingto avoid confusion.
Quoted 6 lines
Hello Vaishali
I know, but netfilter is the part of the outreachy project.
Want to clarify if project patches need to be send on kernel mailing list or not?
Hi Arushi,
My comment was common for your other patches, not specific to patches for netfilter. I just happen to comment on your latest patch in my inbox.
I agree with cc'ing outreachy-kernel mailing list when submitting patches for the netfilter project.
Sorry for the confusion!
Quoted 120 lines
Arushi
Quoted 117 lines
Thank you!
Quoted 99 lines
Signed-off-by Arushi Singhal <[email protected]>--- net/netfilter/nf_conntrack_acct.c | 2 +- net/netfilter/nf_conntrack_ecache.c | 2 +- net/netfilter/nf_conntrack_timestamp.c | 2 +- net/netfilter/nf_nat_core.c | 2 +- net/netfilter/nfnetlink_queue.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-)net/netfilter/nf_conntrack_acct.c +1
-1@@ -80,7 +80,7 @@ static int nf_conntrack_acct_init_sysctl(struct net *net) net->ct.acct_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.acct_sysctl_header) { - printk(KERN_ERR "nf_conntrack_acct: can't register to sysctl.\n"); + netdev_err(net->loopback_dev, "nf_conntrack_acct: can'tregister to sysctl.\n"); goto out_register; } return 0;net/netfilter/nf_conntrack_ecache.c +1
-1@@ -372,7 +372,7 @@ static int nf_conntrack_event_init_sysctl(struct net *net) net->ct.event_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.event_sysctl_header) { - printk(KERN_ERR "nf_ct_event: can't register to sysctl.\n"); + netdev_err(net->loopback_dev, "nf_ct_event: can't register to sysctl.\n");goto out_register; } return 0;net/netfilter/nf_conntrack_timestamp.c +1
-1@@ -58,7 +58,7 @@ static int nf_conntrack_tstamp_init_sysctl(struct net *net) net->ct.tstamp_sysctl_header =register_net_sysctl (net,"net/netfilter" , table);if (!net->ct.tstamp_sysctl_header) { - printk(KERN_ERR "nf_ct_tstamp: can't register to sysctl.\n"); + netdev_err(net->loopback_dev, "nf_ct_tstamp: can'tregister to sysctl.\n"); goto out_register; } return 0;net/netfilter/nf_nat_core.c +1
-1@@ -814,7 +814,7 @@ static int __init nf_nat_init(void) ret =nf_ct_extend_register (&nat_extend);if (ret <0 ) {nf_ct_free_hashtable (nf_nat_bysource, nf_nat_htable_size); -printk (KERN_ERR "nf_nat_core: Unable to register extension\n"); + pr_err("nf_nat_core: Unable to register extension\n" );return ret;}net/netfilter/nfnetlink_queue.c +2
-2@@ -834,8 +834,8 @@ nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e, int diff) nskb =skb_copy_expand (e->skb,skb_headroom (e->skb), diff,GFP_ATOMIC );if (!nskb) { -printk (KERN_WARNING "nf_queue: OOM " -"in mangle, dropping packet\n" ); +netdev_warn (nskb->dev,"nf_queue: OOM " +"in mangle, dropping packet\n");return -ENOMEM; } kfree_skb(e->skb);--
2.7.4Quoted 9 lines
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/20180310183906.GA20125%40seema-Inspiron-15-3567.
For more options, visit https://groups.google.com/d/optout.--
Vaishali
http://vaishalithakkar.in/
Signature · 2 lines
Vaishali http://vaishalithakkar.in/