From e657c679e103e7c5e477f201bc63d6f4a86a4d48 Mon Sep 17 00:00:00 2001 From: Qing Li Date: Fri, 19 Dec 2008 01:37:20 +0000 Subject: [PATCH] The ppp application relies on the if_tun interface to properly install a p2p host route between the end points. The ppp module upates this router based on user configuration later on. The rt_Update() seems to always set the RTF_GATEWAY flag, which is broken. --- usr.sbin/ppp/route.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/ppp/route.c b/usr.sbin/ppp/route.c index f5efe639f8c6..7609681a9edf 100644 --- a/usr.sbin/ppp/route.c +++ b/usr.sbin/ppp/route.c @@ -910,8 +910,10 @@ rt_Update(struct bundle *bundle, const struct sockaddr *dst, p += memcpy_roundup(p, dst, dst->sa_len); } - rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY; + if (gw != NULL && (gw->sa_family != AF_LINK)) + 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);