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

pptp: support sockets bound to an interface

use sk_bound_dev_if for route lookup as already done
in most of the other ip_route_output_ports() calls.

Since most PPPoA providers use 10.0.0.138 as default gateway IP
this will allow connections to multiple PPTP providers with the
same IP address over different interfaces.

Signed-off-by: Ulrich Weber <ulrich.weber@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ulrich Weber and committed by
David S. Miller
43d28c61 8fec380a

+3 -2
+3 -2
drivers/net/ppp/pptp.c
··· 155 155 opt->dst_addr.sin_addr.s_addr, 156 156 opt->src_addr.sin_addr.s_addr, 157 157 0, 0, IPPROTO_GRE, 158 - RT_TOS(0), 0); 158 + RT_TOS(0), sk->sk_bound_dev_if); 159 159 if (IS_ERR(rt)) 160 160 goto tx_error; 161 161 ··· 444 444 opt->dst_addr.sin_addr.s_addr, 445 445 opt->src_addr.sin_addr.s_addr, 446 446 0, 0, 447 - IPPROTO_GRE, RT_CONN_FLAGS(sk), 0); 447 + IPPROTO_GRE, RT_CONN_FLAGS(sk), 448 + sk->sk_bound_dev_if); 448 449 if (IS_ERR(rt)) { 449 450 error = -EHOSTUNREACH; 450 451 goto end;