From 4aad533fbf9d1afeb10de8d0087049afdabd71b3 Mon Sep 17 00:00:00 2001 From: brian Date: Sat, 30 Mar 2002 12:50:49 +0000 Subject: [PATCH] Don't use the RTF_GATEWAY flag and pass the RTA_GATEWAY address when updating routes. --- usr.sbin/ppp/route.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usr.sbin/ppp/route.c b/usr.sbin/ppp/route.c index de88365eed74..64540586b7d9 100644 --- a/usr.sbin/ppp/route.c +++ b/usr.sbin/ppp/route.c @@ -847,7 +847,7 @@ rt_Update(struct bundle *bundle, const struct sockaddr *dst, rtmes.m_rtm.rtm_addrs = 0; rtmes.m_rtm.rtm_seq = ++bundle->routing_seq; rtmes.m_rtm.rtm_pid = getpid(); - rtmes.m_rtm.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC; + rtmes.m_rtm.rtm_flags = RTF_UP | RTF_STATIC; if (bundle->ncp.cfg.sendpipe > 0) { rtmes.m_rtm.rtm_rmx.rmx_sendpipe = bundle->ncp.cfg.sendpipe; @@ -868,6 +868,13 @@ 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 (mask) { + rtmes.m_rtm.rtm_addrs |= RTA_NETMASK; + p += memcpy_roundup(p, mask, mask->sa_len); + } + rtmes.m_rtm.rtm_msglen = p - (char *)&rtmes; wb = ID0write(s, &rtmes, rtmes.m_rtm.rtm_msglen);