* [PATCH] pptp: lookup route with the proper net namespace
@ 2012-08-07 10:23 Gao feng
2012-08-08 22:57 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Gao feng @ 2012-08-07 10:23 UTC (permalink / raw)
To: xeb; +Cc: netdev, Gao feng
pptp always use init_net as the net namespace to lookup
route, this will cause route lookup failed in container.
because we already set the correct net namespace to struct
sock in pptp_create,so fix this by using sock_net(sk) to
replace &init_net.
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
drivers/net/ppp/pptp.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index 1c98321..162464f 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -189,7 +189,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
if (sk_pppox(po)->sk_state & PPPOX_DEAD)
goto tx_error;
- rt = ip_route_output_ports(&init_net, &fl4, NULL,
+ rt = ip_route_output_ports(sock_net(sk), &fl4, NULL,
opt->dst_addr.sin_addr.s_addr,
opt->src_addr.sin_addr.s_addr,
0, 0, IPPROTO_GRE,
@@ -468,7 +468,7 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,
po->chan.private = sk;
po->chan.ops = &pptp_chan_ops;
- rt = ip_route_output_ports(&init_net, &fl4, sk,
+ rt = ip_route_output_ports(sock_net(sk), &fl4, sk,
opt->dst_addr.sin_addr.s_addr,
opt->src_addr.sin_addr.s_addr,
0, 0,
--
1.7.7.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pptp: lookup route with the proper net namespace
2012-08-07 10:23 [PATCH] pptp: lookup route with the proper net namespace Gao feng
@ 2012-08-08 22:57 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-08-08 22:57 UTC (permalink / raw)
To: gaofeng; +Cc: xeb, netdev
From: Gao feng <gaofeng@cn.fujitsu.com>
Date: Tue, 7 Aug 2012 18:23:11 +0800
> pptp always use init_net as the net namespace to lookup
> route, this will cause route lookup failed in container.
>
> because we already set the correct net namespace to struct
> sock in pptp_create,so fix this by using sock_net(sk) to
> replace &init_net.
>
> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-08 22:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-07 10:23 [PATCH] pptp: lookup route with the proper net namespace Gao feng
2012-08-08 22:57 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).