aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorOctavian Purdila <opurdila@ixiacom.com>2009-11-25 18:14:13 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-25 18:14:13 -0500
commit09ad9bc752519cc167d0a573e1acf69b5c707c67 (patch)
tree0e190a9ffb90d7e0534136c3e9f31dce02f423c3 /net/ipv6
parent4ba3eb034fb6fd1990ccc5a6d71d5abcda37b905 (diff)
net: use net_eq to compare nets
Generated with the following semantic patch @@ struct net *n1; struct net *n2; @@ - n1 == n2 + net_eq(n1, n2) @@ struct net *n1; struct net *n2; @@ - n1 != n2 + !net_eq(n1, n2) applied over {include,net,drivers/net}. Signed-off-by: Octavian Purdila <opurdila@ixiacom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/addrconf.c4
-rw-r--r--net/ipv6/ip6_flowlabel.c9
-rw-r--r--net/ipv6/netfilter/ip6_queue.c2
-rw-r--r--net/ipv6/reassembly.c4
4 files changed, 10 insertions, 9 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 522bdc77206c..b1ce8fc62049 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4498,7 +4498,7 @@ static int addrconf_init_net(struct net *net)
4498 all = &ipv6_devconf; 4498 all = &ipv6_devconf;
4499 dflt = &ipv6_devconf_dflt; 4499 dflt = &ipv6_devconf_dflt;
4500 4500
4501 if (net != &init_net) { 4501 if (!net_eq(net, &init_net)) {
4502 all = kmemdup(all, sizeof(ipv6_devconf), GFP_KERNEL); 4502 all = kmemdup(all, sizeof(ipv6_devconf), GFP_KERNEL);
4503 if (all == NULL) 4503 if (all == NULL)
4504 goto err_alloc_all; 4504 goto err_alloc_all;
@@ -4546,7 +4546,7 @@ static void addrconf_exit_net(struct net *net)
4546 __addrconf_sysctl_unregister(net->ipv6.devconf_dflt); 4546 __addrconf_sysctl_unregister(net->ipv6.devconf_dflt);
4547 __addrconf_sysctl_unregister(net->ipv6.devconf_all); 4547 __addrconf_sysctl_unregister(net->ipv6.devconf_all);
4548#endif 4548#endif
4549 if (net != &init_net) { 4549 if (!net_eq(net, &init_net)) {
4550 kfree(net->ipv6.devconf_dflt); 4550 kfree(net->ipv6.devconf_dflt);
4551 kfree(net->ipv6.devconf_all); 4551 kfree(net->ipv6.devconf_all);
4552 } 4552 }
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 593a67e8d3f6..6e7bffa2205e 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -67,7 +67,7 @@ static inline struct ip6_flowlabel *__fl_lookup(struct net *net, __be32 label)
67 struct ip6_flowlabel *fl; 67 struct ip6_flowlabel *fl;
68 68
69 for (fl=fl_ht[FL_HASH(label)]; fl; fl = fl->next) { 69 for (fl=fl_ht[FL_HASH(label)]; fl; fl = fl->next) {
70 if (fl->label == label && fl->fl_net == net) 70 if (fl->label == label && net_eq(fl->fl_net, net))
71 return fl; 71 return fl;
72 } 72 }
73 return NULL; 73 return NULL;
@@ -163,7 +163,8 @@ static void ip6_fl_purge(struct net *net)
163 struct ip6_flowlabel *fl, **flp; 163 struct ip6_flowlabel *fl, **flp;
164 flp = &fl_ht[i]; 164 flp = &fl_ht[i];
165 while ((fl = *flp) != NULL) { 165 while ((fl = *flp) != NULL) {
166 if (fl->fl_net == net && atomic_read(&fl->users) == 0) { 166 if (net_eq(fl->fl_net, net) &&
167 atomic_read(&fl->users) == 0) {
167 *flp = fl->next; 168 *flp = fl->next;
168 fl_free(fl); 169 fl_free(fl);
169 atomic_dec(&fl_size); 170 atomic_dec(&fl_size);
@@ -630,7 +631,7 @@ static struct ip6_flowlabel *ip6fl_get_first(struct seq_file *seq)
630 for (state->bucket = 0; state->bucket <= FL_HASH_MASK; ++state->bucket) { 631 for (state->bucket = 0; state->bucket <= FL_HASH_MASK; ++state->bucket) {
631 fl = fl_ht[state->bucket]; 632 fl = fl_ht[state->bucket];
632 633
633 while (fl && fl->fl_net != net) 634 while (fl && !net_eq(fl->fl_net, net))
634 fl = fl->next; 635 fl = fl->next;
635 if (fl) 636 if (fl)
636 break; 637 break;
@@ -645,7 +646,7 @@ static struct ip6_flowlabel *ip6fl_get_next(struct seq_file *seq, struct ip6_flo
645 646
646 fl = fl->next; 647 fl = fl->next;
647try_again: 648try_again:
648 while (fl && fl->fl_net != net) 649 while (fl && !net_eq(fl->fl_net, net))
649 fl = fl->next; 650 fl = fl->next;
650 651
651 while (!fl) { 652 while (!fl) {
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
index 1cf3f0c6a959..4c7a18abcaff 100644
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -502,7 +502,7 @@ ipq_rcv_nl_event(struct notifier_block *this,
502 if (event == NETLINK_URELEASE && 502 if (event == NETLINK_URELEASE &&
503 n->protocol == NETLINK_IP6_FW && n->pid) { 503 n->protocol == NETLINK_IP6_FW && n->pid) {
504 write_lock_bh(&queue_lock); 504 write_lock_bh(&queue_lock);
505 if ((n->net == &init_net) && (n->pid == peer_pid)) 505 if ((net_eq(n->net, &init_net)) && (n->pid == peer_pid))
506 __ipq_reset(); 506 __ipq_reset();
507 write_unlock_bh(&queue_lock); 507 write_unlock_bh(&queue_lock);
508 } 508 }
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index dce699fb2672..45efc39753e2 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -681,7 +681,7 @@ static int ip6_frags_ns_sysctl_register(struct net *net)
681 struct ctl_table_header *hdr; 681 struct ctl_table_header *hdr;
682 682
683 table = ip6_frags_ns_ctl_table; 683 table = ip6_frags_ns_ctl_table;
684 if (net != &init_net) { 684 if (!net_eq(net, &init_net)) {
685 table = kmemdup(table, sizeof(ip6_frags_ns_ctl_table), GFP_KERNEL); 685 table = kmemdup(table, sizeof(ip6_frags_ns_ctl_table), GFP_KERNEL);
686 if (table == NULL) 686 if (table == NULL)
687 goto err_alloc; 687 goto err_alloc;
@@ -699,7 +699,7 @@ static int ip6_frags_ns_sysctl_register(struct net *net)
699 return 0; 699 return 0;
700 700
701err_reg: 701err_reg:
702 if (net != &init_net) 702 if (!net_eq(net, &init_net))
703 kfree(table); 703 kfree(table);
704err_alloc: 704err_alloc:
705 return -ENOMEM; 705 return -ENOMEM;