Root/package/network/services/ppp/patches/330-retain_foreign_default_routes.patch

1pppd: Retain foreign default routes on Linux
2
3On Linux, when pppd attempts to delete its default route it does not fill
4the rt_dev field of the struct rtentry used to match the system default route.
5As a consequence, pppd happily deletes any default route even if it belongs
6to another interface.
7
8This patch makes pppd fill out the rt_dev field so that only own default
9routes are ever matched.
10
11Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
12
13--- a/pppd/sys-linux.c
14+++ b/pppd/sys-linux.c
15@@ -1755,6 +1755,7 @@ int cifdefaultroute (int unit, u_int32_t
16     SIN_ADDR(rt.rt_genmask) = 0L;
17     }
18 
19+ rt.rt_dev = ifname;
20     rt.rt_flags = RTF_UP;
21     if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) {
22     if (still_ppp()) {
23

Archive Download this file



interactive