PERFORCE change 167173 for review
Ana Kukec
anchie at FreeBSD.org
Mon Aug 10 13:34:48 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=167173
Change 167173 by anchie at 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);
}
More information about the p4-projects
mailing list