OpenWrt – Blame information for rev 3
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | pppd: Retain foreign default routes on Linux |
2 | |||
3 | On Linux, when pppd attempts to delete its default route it does not fill |
||
4 | the rt_dev field of the struct rtentry used to match the system default route. |
||
5 | As a consequence, pppd happily deletes any default route even if it belongs |
||
6 | to another interface. |
||
7 | |||
8 | This patch makes pppd fill out the rt_dev field so that only own default |
||
9 | routes are ever matched. |
||
10 | |||
11 | Signed-off-by: Jo-Philipp Wich <jo@mein.io> |
||
12 | |||
13 | --- a/pppd/sys-linux.c |
||
14 | +++ b/pppd/sys-linux.c |
||
3 | office | 15 | @@ -1756,6 +1756,7 @@ int cifdefaultroute (int unit, u_int32_t |
1 | office | 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()) { |