From: Christos Zoulas Date: Wed, 2 Sep 1998 20:58:13 +0000 (+0000) Subject: When adding a default route, make the route static. Since this is a ``manually X-Git-Tag: RELEASE_2_3_6~54 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=2d429b67dec287282cad25de7f04fd251be86c3a When adding a default route, make the route static. Since this is a ``manually added route'', this arguably follows the network programming guidelines. This is necessary, otherwise it is impossible to make the default route stick in the presense of routed(8). There is a small fix that needs to be applied to routed(8) in if.c (iflookup) where we always want to look for interfaces *once* instead of waiting for the timeout period. This avoids the race where routed finds the route added by pppd before it finds that the ppp inteface is now active. With those two fixes, pppd can happily coexist with routed. --- diff --git a/pppd/sys-bsd.c b/pppd/sys-bsd.c index 0e64dcd..12bbdde 100644 --- a/pppd/sys-bsd.c +++ b/pppd/sys-bsd.c @@ -21,7 +21,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-bsd.c,v 1.31 1998/04/02 12:04:19 paulus Exp $"; +static char rcsid[] = "$Id: sys-bsd.c,v 1.32 1998/09/02 20:58:13 christos Exp $"; /* $NetBSD: sys-bsd.c,v 1.1.1.3 1997/09/26 18:53:04 christos Exp $ */ #endif @@ -1060,7 +1060,7 @@ dodefaultroute(g, cmd) memset(&rtmsg, 0, sizeof(rtmsg)); rtmsg.hdr.rtm_type = cmd == 's'? RTM_ADD: RTM_DELETE; - rtmsg.hdr.rtm_flags = RTF_UP | RTF_GATEWAY; + rtmsg.hdr.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC; rtmsg.hdr.rtm_version = RTM_VERSION; rtmsg.hdr.rtm_seq = ++rtm_seq; rtmsg.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK;