From: Paul Mackerras Date: Sun, 15 Nov 2009 06:08:20 +0000 (+1100) Subject: Specify the device name on the default route deletion X-Git-Tag: ppp-2.4.7~57 X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;ds=sidebyside;h=9856f47063c01096fe6649a21be9a021e42a45fe;p=ppp.git Specify the device name on the default route deletion Some users have reported that pppd will delete a default route through another device, for example if they bring up a ppp connection with default route, then bring up an ethernet interface and set a default route through that, then take down the ppp connection. This fixes it, for Linux at least, by specifying the device name on the default route deletion ioctl, which means that the kernel will only delete default routes through that device. Signed-off-by: Paul Mackerras --- diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 67b50cb..b675c97 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -1658,6 +1658,8 @@ int cifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway) SET_SA_FAMILY (rt.rt_dst, AF_INET); SET_SA_FAMILY (rt.rt_gateway, AF_INET); + rt.rt_dev = ifname; + if (kernel_version > KVERSION(2,1,0)) { SET_SA_FAMILY (rt.rt_genmask, AF_INET); SIN_ADDR(rt.rt_genmask) = 0L;