X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=package%2Fnetwork%2Fservices%2Fppp%2Fpatches%2F110-debian_defaultroute.patch;h=1005c59ab51d0ff2c1c67c96cf8333b02c3db018;hb=88c88823d59de0c123a249357f2f571d2c76ef55;hp=41404aba8378c7e6b80341581e094313885f75b5;hpb=941ab9a89ada8ce32d143668ae509c6741245a17;p=oweals%2Fopenwrt.git diff --git a/package/network/services/ppp/patches/110-debian_defaultroute.patch b/package/network/services/ppp/patches/110-debian_defaultroute.patch index 41404aba83..1005c59ab5 100644 --- a/package/network/services/ppp/patches/110-debian_defaultroute.patch +++ b/package/network/services/ppp/patches/110-debian_defaultroute.patch @@ -8,7 +8,7 @@ connections but not allow them to change the system default route. The patch originated from the Debian project. -Signed-off-by: Jo-Philipp Wich +Signed-off-by: Jo-Philipp Wich --- a/pppd/ipcp.c +++ b/pppd/ipcp.c @@ -153,7 +153,7 @@ Signed-off-by: Jo-Philipp Wich .B nodeflate --- a/pppd/pppd.h +++ b/pppd/pppd.h -@@ -664,7 +664,7 @@ int sif6addr __P((int, eui64_t, eui64_t +@@ -667,7 +667,7 @@ int sif6addr __P((int, eui64_t, eui64_t int cif6addr __P((int, eui64_t, eui64_t)); /* Remove an IPv6 address from i/f */ #endif @@ -164,16 +164,16 @@ Signed-off-by: Jo-Philipp Wich /* Delete default route through i/f */ --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c -@@ -206,6 +206,8 @@ static unsigned char inbuf[512]; /* buff - +@@ -207,6 +207,8 @@ static unsigned char inbuf[512]; /* buff static int if_is_up; /* Interface has been marked up */ + static int if6_is_up; /* Interface has been marked up for IPv6, to help differentiate */ static int have_default_route; /* Gateway for default route added */ +static struct rtentry old_def_rt; /* Old default route */ +static int default_rt_repl_rest; /* replace and restore old default rt */ static u_int32_t proxy_arp_addr; /* Addr for proxy arp entry added */ static char proxy_arp_dev[16]; /* Device for proxy arp entry */ static u_int32_t our_old_addr; /* for detecting address changes */ -@@ -1544,6 +1546,9 @@ static int read_route_table(struct rtent +@@ -1552,6 +1554,9 @@ static int read_route_table(struct rtent p = NULL; } @@ -183,7 +183,7 @@ Signed-off-by: Jo-Philipp Wich SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16); SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16); SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16); -@@ -1613,20 +1618,51 @@ int have_route_to(u_int32_t addr) +@@ -1621,20 +1626,51 @@ int have_route_to(u_int32_t addr) /******************************************************************** * * sifdefaultroute - assign a default route through the address given. @@ -248,7 +248,7 @@ Signed-off-by: Jo-Philipp Wich } memset (&rt, 0, sizeof (rt)); -@@ -1641,10 +1677,16 @@ int sifdefaultroute (int unit, u_int32_t +@@ -1649,10 +1685,16 @@ int sifdefaultroute (int unit, u_int32_t rt.rt_flags = RTF_UP; if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) { @@ -266,7 +266,7 @@ Signed-off-by: Jo-Philipp Wich have_default_route = 1; return 1; -@@ -1675,11 +1717,21 @@ int cifdefaultroute (int unit, u_int32_t +@@ -1683,11 +1725,21 @@ int cifdefaultroute (int unit, u_int32_t rt.rt_flags = RTF_UP; if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) { if (still_ppp()) { @@ -291,7 +291,7 @@ Signed-off-by: Jo-Philipp Wich } --- a/pppd/sys-solaris.c +++ b/pppd/sys-solaris.c -@@ -2036,12 +2036,18 @@ cifaddr(u, o, h) +@@ -2039,12 +2039,18 @@ cifaddr(u, o, h) * sifdefaultroute - assign a default route through the address given. */ int