From 3efad8b4880e08e820158fcdd0cc084e2129211e Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Tue, 25 Mar 2003 17:01:39 +0000 Subject: [PATCH] Once ppp session is over, the route to ff02::tun0/32 was deleted, and never came back. Now, the route to ff02::tun0/32 is installed at the end of IPV6CP negitiaton. --- usr.sbin/ppp/ipv6cp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/usr.sbin/ppp/ipv6cp.c b/usr.sbin/ppp/ipv6cp.c index d89595ef632c..02c30bf5d03b 100644 --- a/usr.sbin/ppp/ipv6cp.c +++ b/usr.sbin/ppp/ipv6cp.c @@ -81,6 +81,12 @@ #ifndef NOINET6 +#define IN6ADDR_LINKLOCAL_MCAST_INIT \ + {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}} +static const struct in6_addr in6addr_linklocal_mcast = + IN6ADDR_LINKLOCAL_MCAST_INIT; + static int ipv6cp_LayerUp(struct fsm *); static void ipv6cp_LayerDown(struct fsm *); static void ipv6cp_LayerStart(struct fsm *); @@ -190,7 +196,8 @@ ipcp_SetIPv6address(struct ipv6cp *ipv6cp, u_char *myifid, u_char *hisifid) { struct bundle *bundle = ipv6cp->fsm.bundle; struct in6_addr myaddr, hisaddr; - struct ncprange myrange; + struct ncprange myrange, range; + struct ncpaddr addr; struct sockaddr_storage ssdst, ssgw, ssmask; struct sockaddr *sadst, *sagw, *samask; @@ -227,6 +234,10 @@ ipcp_SetIPv6address(struct ipv6cp *ipv6cp, u_char *myifid, u_char *hisifid) iface_Clear(bundle->iface, &bundle->ncp, AF_INET6, IFACE_CLEAR_ALIASES|IFACE_SYSTEM); + ncpaddr_setip6(&addr, &in6addr_linklocal_mcast); + ncprange_set(&range, &addr, 32); + rt_Set(bundle, RTM_ADD, &range, &ipv6cp->myaddr, 1, 0); + if (bundle->ncp.cfg.sendpipe > 0 || bundle->ncp.cfg.recvpipe > 0) { ncprange_getsa(&myrange, &ssgw, &ssmask); if (ncpaddr_isset(&ipv6cp->hisaddr))