From owner-p4-projects@FreeBSD.ORG Mon Aug 10 13:34:48 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6CE561065675; Mon, 10 Aug 2009 13:34:47 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C579106564A for ; Mon, 10 Aug 2009 13:34:47 +0000 (UTC) (envelope-from anchie@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 1B6FA8FC1F for ; Mon, 10 Aug 2009 13:34:47 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n7ADYkbl034994 for ; Mon, 10 Aug 2009 13:34:46 GMT (envelope-from anchie@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n7ADYkaL034992 for perforce@freebsd.org; Mon, 10 Aug 2009 13:34:46 GMT (envelope-from anchie@FreeBSD.org) Date: Mon, 10 Aug 2009 13:34:46 GMT Message-Id: <200908101334.n7ADYkaL034992@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to anchie@FreeBSD.org using -f From: Ana Kukec To: Perforce Change Reviews Cc: Subject: PERFORCE change 167173 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2009 13:34:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=167173 Change 167173 by anchie@anchie_malimis on 2009/08/10 13:34:32 Minor changes. Affected files ... .. //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#11 edit .. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#16 edit Differences ... ==== //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#11 (text+ko) ==== @@ -533,6 +533,9 @@ ifp = ifnet_byindex(rtm->rtm_index); if (ifp) { m_adj(m, sizeof (struct if_announcemsghdr)); +#if 0 + m->m_data += sizeof (struct if_announcemsghdr); +#endif printf("rtm->rtm_index = %d\n", rtm->rtm_index); send_output_hook(m, ifp, SND_IN); } else { @@ -543,11 +546,11 @@ case RTM_SND_OUT: ifp = ifnet_byindex(rtm->rtm_index); if (ifp) { -#if 0 m_adj(m, sizeof (struct if_announcemsghdr)); -#endif printf("if_index = %u\n", ifp->if_index); +#if 0 m->m_data += sizeof (struct if_announcemsghdr); +#endif send_output_hook(m, ifp, SND_OUT); } else printf("route_output: ifp == NULL"); ==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#16 (text+ko) ==== @@ -1727,7 +1727,7 @@ struct ip6_hdr *ip6; int error = 0; int flags = 0; - int ip6len; + int ip6len, skip = 0; unsigned short *nd_type; printf("%s %d\n", __FUNCTION__, __LINE__); @@ -1914,14 +1914,15 @@ if (send_input_hook != NULL) { mtag = m_tag_find(m, PACKET_TAG_ND_OUTGOING, NULL); if (mtag != NULL) { + skip = 1; printf("%s: ND_OUTGOING tag found.\n", __FUNCTION__); nd_type = (unsigned short *)(mtag + 1); - send_input_hook(m, ifp, 0, ip6len); + send_input_hook(m, ifp, SND_OUT, ip6len); } else error = EOPNOTSUPP; return error; - } else { + } /* * We were passed in a pointer to an lle with the lock held @@ -1963,7 +1964,7 @@ } error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, NULL); printf("%s %d: nakon if_output()\n", __FUNCTION__, __LINE__); - } + return (error); bad: @@ -1977,8 +1978,10 @@ else LLE_RUNLOCK(ln); } - if (m) - m_freem(m); + if (skip) { + if (m) + m_freem(m); + } return (error); } #undef senderr @@ -2059,6 +2062,8 @@ { struct llentry *ln; + printf("nd6_storelladdr\n"); + *lle = NULL; IF_AFDATA_UNLOCK_ASSERT(ifp); if (m->m_flags & M_MCAST) { @@ -2075,6 +2080,7 @@ #endif case IFT_BRIDGE: case IFT_ISO88025: + printf("nd6_storelladdr, IFT_ETHER\n"); ETHER_MAP_IPV6_MULTICAST(&SIN6(dst)->sin6_addr, desten); return (0); @@ -2099,13 +2105,23 @@ /* * the entry should have been created in nd6_store_lladdr */ + { + char ip6buf[INET6_ADDRSTRLEN]; + + printf("XXX-BZ, nd6_storelladdr: ifp=%p, xname=%s, dst=%s\n", ifp, ifp->if_xname, ip6_sprintf(ip6buf, &((struct sockaddr_in6 *)dst)->sin6_addr)); + } + IF_AFDATA_LOCK(ifp); ln = lla_lookup(LLTABLE6(ifp), 0, dst); IF_AFDATA_UNLOCK(ifp); + /* ToFix: ln == NULL! lla_lookup -> generic link layer lookup func. */ if ((ln == NULL) || !(ln->la_flags & LLE_VALID)) { - if (ln != NULL) + printf("ln == NULL etc...\n"); + if (ln != NULL) { LLE_RUNLOCK(ln); + } /* this could happen, if we could not allocate memory */ + printf("nd6_storelladdr: could not allocate memory.\n"); m_freem(m); return (1); }