summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/route.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2002-03-30 12:50:49 +0000
committerbrian <brian@FreeBSD.org>2002-03-30 12:50:49 +0000
commit4aad533fbf9d1afeb10de8d0087049afdabd71b3 (patch)
treeb6e57b0992c0c6b588a04f5544eacf7e23fdf9c4 /usr.sbin/ppp/route.c
parent1dda0c6402d20822aa346a094e5d3941d29a3e8f (diff)
downloadFreeBSD-src-4aad533fbf9d1afeb10de8d0087049afdabd71b3.zip
FreeBSD-src-4aad533fbf9d1afeb10de8d0087049afdabd71b3.tar.gz
Don't use the RTF_GATEWAY flag and pass the RTA_GATEWAY address when updating
routes.
Diffstat (limited to 'usr.sbin/ppp/route.c')
-rw-r--r--usr.sbin/ppp/route.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/ppp/route.c b/usr.sbin/ppp/route.c
index de88365..6454058 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);
OpenPOWER on IntegriCloud