Date: Wed, 17 Dec 2008 10:03:49 +0000 (UTC) From: Qing Li <qingli@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r186215 - head/sys/netinet6 Message-ID: <200812171003.mBHA3n8x000883@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: qingli Date: Wed Dec 17 10:03:49 2008 New Revision: 186215 URL: http://svn.freebsd.org/changeset/base/186215 Log: in6_clsroute() was applied to prefix routes causing some of them to expire. in6_clsroute() was only applied to cloned routes that are no longer applicable after the arp-v2 commit. Modified: head/sys/netinet6/in6.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Dec 17 08:18:11 2008 (r186214) +++ head/sys/netinet6/in6.c Wed Dec 17 10:03:49 2008 (r186215) @@ -987,6 +987,13 @@ in6_update_ifa(struct ifnet *ifp, struct } } if (!rt) { + + printf("in6_update_ifa #1: addr= %s, mask= %s, ia= %s, ifp = %s\n", + ip6_sprintf(ip6buf, &mltaddr.sin6_addr), + ip6_sprintf(ip6buf, &mltmask.sin6_addr), + ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr), + if_name(ifp)); + error = rtrequest(RTM_ADD, (struct sockaddr *)&mltaddr, (struct sockaddr *)&ia->ia_addr, (struct sockaddr *)&mltmask, RTF_UP, @@ -1061,6 +1068,12 @@ in6_update_ifa(struct ifnet *ifp, struct } } if (!rt) { + printf("in6_update_ifa #2: addr= %s, mask= %s, ia= %s, ifp = %s\n", + ip6_sprintf(ip6buf, &mltaddr.sin6_addr), + ip6_sprintf(ip6buf, &mltmask.sin6_addr), + ip6_sprintf(ip6buf, &ia->ia_addr.sin6_addr), + if_name(ifp)); + error = rtrequest(RTM_ADD, (struct sockaddr *)&mltaddr, (struct sockaddr *)&ia->ia_addr, (struct sockaddr *)&mltmask, RTF_UP, Modified: head/sys/netinet6/in6_rmx.c ============================================================================== --- head/sys/netinet6/in6_rmx.c Wed Dec 17 08:18:11 2008 (r186214) +++ head/sys/netinet6/in6_rmx.c Wed Dec 17 10:03:49 2008 (r186215) @@ -220,33 +220,6 @@ SYSCTL_V_INT(V_NET, vnet_inet6, _net_ine rtmaxcache, CTLFLAG_RW, rtq_toomany6 , 0, ""); -/* - * On last reference drop, mark the route as belong to us so that it can be - * timed out. - */ -static void -in6_clsroute(struct radix_node *rn, struct radix_node_head *head) -{ - INIT_VNET_INET6(curvnet); - struct rtentry *rt = (struct rtentry *)rn; - - RT_LOCK_ASSERT(rt); - - if (!(rt->rt_flags & RTF_UP)) - return; /* prophylactic measures */ - - /* - * As requested by David Greenman: - * If rtq_reallyold6 is 0, just delete the route without - * waiting for a timeout cycle to kill it. - */ - if (V_rtq_reallyold6 != 0) { - rt->rt_flags |= RTPRF_OURS; - rt->rt_rmx.rmx_expire = time_uptime + V_rtq_reallyold6; - } else { - rtexpunge(rt); - } -} struct rtqk_arg { struct radix_node_head *rnh; @@ -469,7 +442,6 @@ in6_inithead(void **head, int off) rnh = *head; rnh->rnh_addaddr = in6_addroute; rnh->rnh_matchaddr = in6_matroute; - rnh->rnh_close = in6_clsroute; callout_init(&V_rtq_timer6, CALLOUT_MPSAFE); in6_rtqtimo(rnh); /* kick off timeout first time */ callout_init(&V_rtq_mtutimer, CALLOUT_MPSAFE); Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Wed Dec 17 08:18:11 2008 (r186214) +++ head/sys/netinet6/nd6.c Wed Dec 17 10:03:49 2008 (r186215) @@ -1713,7 +1713,6 @@ nd6_output_lle(struct ifnet *ifp, struct { INIT_VNET_INET6(curvnet); struct mbuf *m = m0; - struct rtentry *rt = rt0; struct llentry *ln = lle; int error = 0; int flags = 0; @@ -1746,9 +1745,9 @@ nd6_output_lle(struct ifnet *ifp, struct flags = ((m != NULL) || (lle != NULL)) ? LLE_EXCLUSIVE : 0; if (ln == NULL) { retry: - IF_AFDATA_LOCK(rt->rt_ifp); + IF_AFDATA_LOCK(ifp); ln = lla_lookup(LLTABLE6(ifp), flags, (struct sockaddr *)dst); - IF_AFDATA_UNLOCK(rt->rt_ifp); + IF_AFDATA_UNLOCK(ifp); if ((ln == NULL) && nd6_is_addr_neighbor(dst, ifp)) { /* * Since nd6_is_addr_neighbor() internally calls nd6_lookup(), @@ -1756,9 +1755,9 @@ nd6_output_lle(struct ifnet *ifp, struct * it is tolerable, because this should be a rare case. */ flags = ND6_CREATE | (m ? ND6_EXCLUSIVE : 0); - IF_AFDATA_LOCK(rt->rt_ifp); + IF_AFDATA_LOCK(ifp); ln = nd6_lookup(&dst->sin6_addr, flags, ifp); - IF_AFDATA_UNLOCK(rt->rt_ifp); + IF_AFDATA_UNLOCK(ifp); } } if (ln == NULL) { @@ -1767,8 +1766,8 @@ nd6_output_lle(struct ifnet *ifp, struct char ip6buf[INET6_ADDRSTRLEN]; log(LOG_DEBUG, "nd6_output: can't allocate llinfo for %s " - "(ln=%p, rt=%p)\n", - ip6_sprintf(ip6buf, &dst->sin6_addr), ln, rt); + "(ln=%p)\n", + ip6_sprintf(ip6buf, &dst->sin6_addr), ln); senderr(EIO); /* XXX: good error? */ } goto sendpkt; /* send anyway */ @@ -1915,9 +1914,9 @@ nd6_output_lle(struct ifnet *ifp, struct } if ((ifp->if_flags & IFF_LOOPBACK) != 0) { return ((*ifp->if_output)(origifp, m, (struct sockaddr *)dst, - rt)); + NULL)); } - error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, rt); + error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, NULL); return (error); bad: @@ -2008,7 +2007,7 @@ nd6_need_cache(struct ifnet *ifp) * the lle lock, drop here for now */ int -nd6_storelladdr(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m, +nd6_storelladdr(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, u_char *desten, struct llentry **lle) { struct llentry *ln; Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Wed Dec 17 08:18:11 2008 (r186214) +++ head/sys/netinet6/nd6.h Wed Dec 17 10:03:49 2008 (r186215) @@ -397,7 +397,7 @@ int nd6_output_lle __P((struct ifnet *, int nd6_output_flush __P((struct ifnet *, struct ifnet *, struct mbuf *, struct sockaddr_in6 *, struct rtentry *)); int nd6_need_cache __P((struct ifnet *)); -int nd6_storelladdr __P((struct ifnet *, struct rtentry *, struct mbuf *, +int nd6_storelladdr __P((struct ifnet *, struct mbuf *, struct sockaddr *, u_char *, struct llentry **)); /* nd6_nbr.c */ Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Wed Dec 17 08:18:11 2008 (r186214) +++ head/sys/netinet6/nd6_rtr.c Wed Dec 17 10:03:49 2008 (r186215) @@ -1554,6 +1554,12 @@ nd6_prefix_onlink(struct nd_prefix *pr) char ip6buf[INET6_ADDRSTRLEN]; struct sockaddr_dl null_sdl = {sizeof(null_sdl), AF_LINK}; + + log(LOG_DEBUG, "##1 nd6_prefix_onlink: %s, vltime = %x, pltime = %x\n", + ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), + pr->ndpr_vltime, pr->ndpr_pltime); + + /* sanity check */ if ((pr->ndpr_stateflags & NDPRF_ONLINK) != 0) { nd6log((LOG_ERR, @@ -1622,6 +1628,12 @@ nd6_prefix_onlink(struct nd_prefix *pr) rtflags = ifa->ifa_flags | RTF_UP; error = rtrequest(RTM_ADD, (struct sockaddr *)&pr->ndpr_prefix, ifa->ifa_addr, (struct sockaddr *)&mask6, rtflags, &rt); + + log(LOG_DEBUG, "##2 nd6_prefix_onlink: %s, vltime = %x, pltime = %x\n", + ip6_sprintf(ip6buf, &pr->ndpr_prefix.sin6_addr), + pr->ndpr_vltime, pr->ndpr_pltime); + + if (error == 0) { if (rt != NULL) /* this should be non NULL, though */ { rnh = V_rt_tables[rt->rt_fibnum][AF_INET6];
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812171003.mBHA3n8x000883>