-/* $OpenBSD: in6_ifattach.c,v 1.64 2013/11/28 10:16:44 mpi Exp $ */
+/* $OpenBSD: in6_ifattach.c,v 1.65 2014/01/06 13:01:20 stsp Exp $ */
/* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */
/*
*/
nd6_purge(ifp);
+ /* remove route to interface local allnodes multicast (ff01::1) */
+ bzero(&sin6, sizeof(sin6));
+ sin6.sin6_len = sizeof(struct sockaddr_in6);
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_addr = in6addr_intfacelocal_allnodes;
+ sin6.sin6_addr.s6_addr16[1] = htons(ifp->if_index);
+ rt = rtalloc1(sin6tosa(&sin6), 0, ifp->if_rdomain);
+ if (rt && rt->rt_ifp == ifp) {
+ struct rt_addrinfo info;
+
+ bzero(&info, sizeof(info));
+ info.rti_flags = rt->rt_flags;
+ info.rti_info[RTAX_DST] = rt_key(rt);
+ info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
+ info.rti_info[RTAX_NETMASK] = rt_mask(rt);
+ rtrequest1(RTM_DELETE, &info, rt->rt_priority, NULL,
+ ifp->if_rdomain);
+ rtfree(rt);
+ }
+
/* remove route to link-local allnodes multicast (ff02::1) */
bzero(&sin6, sizeof(sin6));
sin6.sin6_len = sizeof(struct sockaddr_in6);