summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2009-04-20 11:51:35 +0000
committerbz <bz@FreeBSD.org>2009-04-20 11:51:35 +0000
commitc47c606500aa16fb8a70a28da2d1d32a12ed43c2 (patch)
tree6ca55f8480f44a1a972460decf275a75a06260d9 /usr.sbin/ppp
parent1a4d93caae0d800baf8db692c68e58bcde36c06e (diff)
downloadFreeBSD-src-c47c606500aa16fb8a70a28da2d1d32a12ed43c2.zip
FreeBSD-src-c47c606500aa16fb8a70a28da2d1d32a12ed43c2.tar.gz
While we currently still seem to have a gateway address, for future
stability, check for gw to be set before adding the flag and the address to the routing message. r186308, backed out in r191305, already tried to do that, and in addition ignore AF_LINK types of gateway addresses to work around a problem that r167797 had introduced on the kernel side always setting RTF_GATEWAY if a gateway address was passed into the kernel. The proper solution for this is still under discussion so I am hesitant to re-add the special AF_LINK treatment for now. MFC after: 3 days
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/route.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/ppp/route.c b/usr.sbin/ppp/route.c
index f5efe63..d55a06b 100644
--- a/usr.sbin/ppp/route.c
+++ b/usr.sbin/ppp/route.c
@@ -910,8 +910,11 @@ rt_Update(struct bundle *bundle, const struct sockaddr *dst,
p += memcpy_roundup(p, dst, dst->sa_len);
}
- rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY;
- p += memcpy_roundup(p, gw, gw->sa_len);
+ if (gw) {
+ rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY;
+ p += memcpy_roundup(p, gw, gw->sa_len);
+ }
+
if (mask) {
rtmes.m_rtm.rtm_addrs |= RTA_NETMASK;
p += memcpy_roundup(p, mask, mask->sa_len);
OpenPOWER on IntegriCloud