mirror of
https://abf.rosa.ru/djam/ppp.git
synced 2025-02-23 14:12:59 +00:00
52 lines
2.8 KiB
Diff
52 lines
2.8 KiB
Diff
![]() |
diff -p -up ppp-2.4.4/pppd/ipcp.c.multipledefrt ppp-2.4.4/pppd/ipcp.c
|
||
|
--- ppp-2.4.4/pppd/ipcp.c.multipledefrt 2005-08-26 01:59:34.000000000 +0200
|
||
|
+++ ppp-2.4.4/pppd/ipcp.c 2008-06-03 10:39:15.000000000 +0200
|
||
|
@@ -196,6 +196,8 @@ static option_t ipcp_option_list[] = {
|
||
|
{ "-defaultroute", o_bool, &ipcp_allowoptions[0].default_route,
|
||
|
"disable defaultroute option", OPT_ALIAS | OPT_A2CLR,
|
||
|
&ipcp_wantoptions[0].default_route },
|
||
|
+ { "multipledefaultroutes", o_bool, &ipcp_wantoptions[0].multiple_def_routes,
|
||
|
+ "Add default route even if one already exists", 1 },
|
||
|
|
||
|
{ "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp,
|
||
|
"Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp },
|
||
|
diff -p -up ppp-2.4.4/pppd/ipcp.h.multipledefrt ppp-2.4.4/pppd/ipcp.h
|
||
|
--- ppp-2.4.4/pppd/ipcp.h.multipledefrt 2002-12-05 00:03:32.000000000 +0100
|
||
|
+++ ppp-2.4.4/pppd/ipcp.h 2008-06-03 10:41:46.000000000 +0200
|
||
|
@@ -70,6 +70,7 @@ typedef struct ipcp_options {
|
||
|
bool old_addrs; /* Use old (IP-Addresses) option? */
|
||
|
bool req_addr; /* Ask peer to send IP address? */
|
||
|
bool default_route; /* Assign default route through interface? */
|
||
|
+ bool multiple_def_routes; /* Allow multiple default routes? */
|
||
|
bool proxy_arp; /* Make proxy ARP entry for peer? */
|
||
|
bool neg_vj; /* Van Jacobson Compression? */
|
||
|
bool old_vj; /* use old (short) form of VJ option? */
|
||
|
diff -p -up ppp-2.4.4/pppd/pppd.8.multipledefrt ppp-2.4.4/pppd/pppd.8
|
||
|
--- ppp-2.4.4/pppd/pppd.8.multipledefrt 2008-06-03 10:35:47.000000000 +0200
|
||
|
+++ ppp-2.4.4/pppd/pppd.8 2008-06-03 10:39:59.000000000 +0200
|
||
|
@@ -120,6 +120,12 @@ Add a default route to the system routin
|
||
|
the gateway, when IPCP negotiation is successfully completed.
|
||
|
This entry is removed when the PPP connection is broken. This option
|
||
|
is privileged if the \fInodefaultroute\fR option has been specified.
|
||
|
+.B multipledefaultroutes
|
||
|
+This option is a flag to the defaultroute option. If defaultroute is
|
||
|
+set and this flag is also set, pppd will add the new default route
|
||
|
+even if there is already a default route, allowing multiple default
|
||
|
+routes.
|
||
|
+.TP
|
||
|
.TP
|
||
|
.B disconnect \fIscript
|
||
|
Execute the command specified by \fIscript\fR, by passing it to a
|
||
|
diff -p -up ppp-2.4.4/pppd/sys-linux.c.multipledefrt ppp-2.4.4/pppd/sys-linux.c
|
||
|
--- ppp-2.4.4/pppd/sys-linux.c.multipledefrt 2008-06-03 10:35:47.000000000 +0200
|
||
|
+++ ppp-2.4.4/pppd/sys-linux.c 2008-06-03 10:40:14.000000000 +0200
|
||
|
@@ -1588,7 +1588,7 @@ int sifdefaultroute (int unit, u_int32_t
|
||
|
{
|
||
|
struct rtentry rt;
|
||
|
|
||
|
- if (defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
|
||
|
+ if (!ipcp_wantoptions[0].multiple_def_routes && defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
|
||
|
if (rt.rt_flags & RTF_GATEWAY)
|
||
|
error("not replacing existing default route via %I",
|
||
|
SIN_ADDR(rt.rt_gateway));
|