Commit 08252b32 authored by Gao feng's avatar Gao feng Committed by David S. Miller

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: default avatarGao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d933d2be
...@@ -189,7 +189,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb) ...@@ -189,7 +189,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
if (sk_pppox(po)->sk_state & PPPOX_DEAD) if (sk_pppox(po)->sk_state & PPPOX_DEAD)
goto tx_error; 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->dst_addr.sin_addr.s_addr,
opt->src_addr.sin_addr.s_addr, opt->src_addr.sin_addr.s_addr,
0, 0, IPPROTO_GRE, 0, 0, IPPROTO_GRE,
...@@ -468,7 +468,7 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr, ...@@ -468,7 +468,7 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,
po->chan.private = sk; po->chan.private = sk;
po->chan.ops = &pptp_chan_ops; 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->dst_addr.sin_addr.s_addr,
opt->src_addr.sin_addr.s_addr, opt->src_addr.sin_addr.s_addr,
0, 0, 0, 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment