Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Gao feng and committed by
David S. Miller
08252b32 d933d2be

+2 -2
+2 -2
drivers/net/ppp/pptp.c
··· 189 189 if (sk_pppox(po)->sk_state & PPPOX_DEAD) 190 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 193 opt->dst_addr.sin_addr.s_addr, 194 194 opt->src_addr.sin_addr.s_addr, 195 195 0, 0, IPPROTO_GRE, ··· 468 468 po->chan.private = sk; 469 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 472 opt->dst_addr.sin_addr.s_addr, 473 473 opt->src_addr.sin_addr.s_addr, 474 474 0, 0,