From 6d0ff7606bd8cd8c41fa8ca403ea8f4e9e33b27b Mon Sep 17 00:00:00 2001 From: bz Date: Wed, 22 Apr 2009 08:37:02 +0000 Subject: [PATCH] MFC r191305: Back out r186308 (r191014 in stable/7): In case of AF_LINK, which the kernel still returns for an RTAX_GATEWAY as an empty sockaddr_dl in the classic tun case: copying the address into the message payload, but not the RTA_GATEWAY flag results in rt_xaddrs() in the kernel tripping over that and parsing the next attribute set with a flag, i.e. RTA_NETMASK, with the gateway address, resulting in bogus route entry. Approved by: re (kensmith) git-svn-id: svn://svn.freebsd.org/base/releng/7.2@191373 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.sbin/ppp/route.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/usr.sbin/ppp/route.c b/usr.sbin/ppp/route.c index f8fc94b6..fdc60020 100644 --- a/usr.sbin/ppp/route.c +++ b/usr.sbin/ppp/route.c @@ -902,10 +902,8 @@ rt_Update(struct bundle *bundle, const struct sockaddr *dst, p += memcpy_roundup(p, dst, dst->sa_len); } - if (gw != NULL && (gw->sa_family != AF_LINK)) - rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY; + 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); -- 2.42.0