[package] ppp: honour option auto in atm hotplug
[openwrt/svn-archive/archive.git] / package / ppp / patches / 340-populate_default_gateway.patch
1 --- a/pppd/sys-linux.c
2 +++ b/pppd/sys-linux.c
3 @@ -1673,6 +1673,9 @@ int sifdefaultroute (int unit, u_int32_t
4 memset (&rt, 0, sizeof (rt));
5 SET_SA_FAMILY (rt.rt_dst, AF_INET);
6
7 + SET_SA_FAMILY(rt.rt_gateway, AF_INET);
8 + SIN_ADDR(rt.rt_gateway) = gateway;
9 +
10 rt.rt_dev = ifname;
11
12 if (kernel_version > KVERSION(2,1,0)) {
13 @@ -1680,7 +1683,7 @@ int sifdefaultroute (int unit, u_int32_t
14 SIN_ADDR(rt.rt_genmask) = 0L;
15 }
16
17 - rt.rt_flags = RTF_UP;
18 + rt.rt_flags = RTF_UP | RTF_GATEWAY;
19 if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) {
20 if (!ok_error(errno))
21 error("default route ioctl(SIOCADDRT): %m");