From: "Denis V. Lunev" <den@openvz.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, devel@openvz.org,
"Denis V. Lunev" <den@openvz.org>
Subject: [PATCH 2/8 net-2.6.25] [NETNS] Make arp code network namespace consistent.
Date: Mon, 14 Jan 2008 17:59:55 +0300 [thread overview]
Message-ID: <1200322801-19054-2-git-send-email-den@openvz.org> (raw)
In-Reply-To: <478B78CB.4030404@openvz.org>
Some calls in the arp.c have network namespace as an argument. Getting
init_net inside these functions is simply inconsistent. Fix this.
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
net/ipv4/arp.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 49c24ff..0db7d49 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -969,13 +969,13 @@ static int arp_req_set_public(struct net *net, struct arpreq *r,
if (mask && mask != htonl(0xFFFFFFFF))
return -EINVAL;
if (!dev && (r->arp_flags & ATF_COM)) {
- dev = dev_getbyhwaddr(&init_net, r->arp_ha.sa_family,
+ dev = dev_getbyhwaddr(net, r->arp_ha.sa_family,
r->arp_ha.sa_data);
if (!dev)
return -ENODEV;
}
if (mask) {
- if (pneigh_lookup(&arp_tbl, &init_net, &ip, dev, 1) == NULL)
+ if (pneigh_lookup(&arp_tbl, net, &ip, dev, 1) == NULL)
return -ENOBUFS;
return 0;
}
@@ -1084,7 +1084,7 @@ static int arp_req_delete_public(struct net *net, struct arpreq *r,
__be32 mask = ((struct sockaddr_in *)&r->arp_netmask)->sin_addr.s_addr;
if (mask == htonl(0xFFFFFFFF))
- return pneigh_delete(&arp_tbl, &init_net, &ip, dev);
+ return pneigh_delete(&arp_tbl, net, &ip, dev);
if (mask)
return -EINVAL;
@@ -1162,7 +1162,7 @@ int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg)
rtnl_lock();
if (r.arp_dev[0]) {
err = -ENODEV;
- if ((dev = __dev_get_by_name(&init_net, r.arp_dev)) == NULL)
+ if ((dev = __dev_get_by_name(net, r.arp_dev)) == NULL)
goto out;
/* Mmmm... It is wrong... ARPHRD_NETROM==0 */
--
1.5.3.rc5
next prev parent reply other threads:[~2008-01-14 15:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-14 14:59 [PATCH 0/8 2.6.25] a set of small code cleanups Denis V. Lunev
2008-01-14 14:59 ` [PATCH 1/8 net-2.6.25] [ARP] Move inet_addr_type call after simple error checks in arp_contructor Denis V. Lunev
2008-01-14 14:59 ` Denis V. Lunev [this message]
2008-01-14 14:59 ` [PATCH 3/8 net-2.6.25] [IPV4] fib_rules_unregister is essentially void Denis V. Lunev
2008-01-14 14:59 ` [PATCH 4/8 net-2.6.25] [ARP] Remove overkill checks from neigh_param_alloc Denis V. Lunev
2008-01-14 14:59 ` [PATCH 5/8 net-2.6.25] [ARP] Remove forward declaration of neigh_changeaddr Denis V. Lunev
2008-01-14 14:59 ` [PATCH 6/8 net-2.6.25] [ARP] neigh_parms_put(destroy) are essentially local to core/neighbour.c Denis V. Lunev
2008-01-15 7:04 ` David Miller
2008-01-14 15:00 ` [PATCH 7/8 net-2.6.25] [IPV4] Remove extra argument from arp_ignore Denis V. Lunev
2008-01-14 15:00 ` [PATCH 8/8 net-2.6.25] [NETNS] Process inet_confirm_addr in the correct namespace Denis V. Lunev
2008-01-15 7:06 ` [PATCH 0/8 2.6.25] a set of small code cleanups David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1200322801-19054-2-git-send-email-den@openvz.org \
--to=den@openvz.org \
--cc=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.