diff options
author | Gao feng <gaofeng@cn.fujitsu.com> | 2012-08-06 20:23:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-08 18:57:10 -0400 |
commit | 08252b32311c3fa84219ad794d640af7399b5485 (patch) | |
tree | 2198ed2425cdcdcd7d69a5c32f3de87419c26c1d /drivers/net/ppp | |
parent | d933d2beb1e416f62bf56fe002e5451414f9a9d2 (diff) |
pptp: lookup route with the proper net namespace
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ppp')
-rw-r--r-- | 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 1c98321b56cc..162464fe86bf 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) | |||
189 | if (sk_pppox(po)->sk_state & PPPOX_DEAD) | 189 | if (sk_pppox(po)->sk_state & PPPOX_DEAD) |
190 | goto tx_error; | 190 | goto tx_error; |
191 | 191 | ||
192 | rt = ip_route_output_ports(&init_net, &fl4, NULL, | 192 | rt = ip_route_output_ports(sock_net(sk), &fl4, NULL, |
193 | opt->dst_addr.sin_addr.s_addr, | 193 | opt->dst_addr.sin_addr.s_addr, |
194 | opt->src_addr.sin_addr.s_addr, | 194 | opt->src_addr.sin_addr.s_addr, |
195 | 0, 0, IPPROTO_GRE, | 195 | 0, 0, IPPROTO_GRE, |
@@ -468,7 +468,7 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr, | |||
468 | po->chan.private = sk; | 468 | po->chan.private = sk; |
469 | po->chan.ops = &pptp_chan_ops; | 469 | po->chan.ops = &pptp_chan_ops; |
470 | 470 | ||
471 | rt = ip_route_output_ports(&init_net, &fl4, sk, | 471 | rt = ip_route_output_ports(sock_net(sk), &fl4, sk, |
472 | opt->dst_addr.sin_addr.s_addr, | 472 | opt->dst_addr.sin_addr.s_addr, |
473 | opt->src_addr.sin_addr.s_addr, | 473 | opt->src_addr.sin_addr.s_addr, |
474 | 0, 0, | 474 | 0, 0, |