PERFORCE change 168042 for review

Ana Kukec anchie at FreeBSD.org
Tue Sep 1 12:07:22 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=168042

Change 168042 by anchie at anchie_malimis on 2009/09/01 12:06:30

	Removed printfs used for debugging.	

Affected files ...

.. //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#19 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/icmp6.c#23 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#18 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6_nbr.c#10 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#29 edit

Differences ...

==== //depot/projects/soc2009/anchie_send/src/sys/net/rtsock.c#19 (text+ko) ====

@@ -523,22 +523,18 @@
 		struct rtentry *saved_nrt;
 
 	case RTM_SND:
-		printf("RTM_SND!\n");
-
 		switch (rtm->rtm_seq) {
 			struct mbuf *n;
 
 		case RTM_SND_IN: 
 			ifp = ifnet_byindex(rtm->rtm_index);
-			if (!ifp) {
-				printf("%s: RTM_SND_IN ifp == NULL", __func__);
+			if (!ifp)
 				senderr(EINVAL);
-			}
-			if ((n = m_dup(m, M_DONTWAIT)) == NULL) {
-				printf("%s: RTM_SND_IN n == NULL", __func__);
+
+			if ((n = m_dup(m, M_DONTWAIT)) == NULL)
 				senderr(ENOBUFS);
-			}
 			m_adj(n, sizeof(struct rt_msghdr));
+
 			printf("%s: RTM_SND_IN ifp=%p(%s), mbuf=%p\n",
 			    __func__, ifp, ifp->if_xname, n);
 			error = send_output_hook(n, ifp, SND_IN);
@@ -547,15 +543,13 @@
 			goto flush;
 		case RTM_SND_OUT:
 			ifp = ifnet_byindex(rtm->rtm_index);
-			if (!ifp) {
-				printf("%s: RTM_SND_OUT ifp == NULL", __func__);
+			if (!ifp)
 				senderr(EINVAL);
-			}
-			if ((n = m_dup(m, M_DONTWAIT)) == NULL) {
-				printf("%s: RTM_SND_OUT n == NULL", __func__);
+
+			if ((n = m_dup(m, M_DONTWAIT)) == NULL)
 				senderr(ENOBUFS);
-			}
 			m_adj(n, sizeof(struct rt_msghdr));
+
 			printf("%s: RTM_SND_OUT ifp=%p(%s), mbuf=%p\n",
 			    __func__, ifp, ifp->if_xname, n);
 			error = send_output_hook(n, ifp, SND_OUT);
@@ -952,7 +946,6 @@
 	if (m && len > MHLEN) {
 		MCLGET(m, M_DONTWAIT);
 		if ((m->m_flags & M_EXT) == 0) {
-			printf("rtsock.c: rt_msg1(), m_free 1\n");
 			m_free(m);
 			m = NULL;
 		}
@@ -972,7 +965,6 @@
 		len += dlen;
 	}
 	if (m->m_pkthdr.len != len) {
-		printf("rtsock.c: rt_msg1(), m_free 2");
 		m_freem(m);
 		return (NULL);
 	}
@@ -1218,22 +1210,18 @@
 	struct if_announcemsghdr *ifan;
 	struct mbuf *m;
 
-	printf("rtsock.c: rt_makeifannouncemsg()\n");
-
 	if (route_cb.any_count == 0)
 		return NULL;
 	bzero((caddr_t)info, sizeof(*info));
-	printf("rtsock.c: rt_makeifannouncemsg(), prije rt_msg1()\n");
 	m = rt_msg1(type, info);
-	printf("rtsock.c: rt_makeifannouncemsg(), nakon rt_msg1()\n");
 	if (m != NULL) {
 		ifan = mtod(m, struct if_announcemsghdr *);
 		ifan->ifan_index = ifp->if_index;
 		strlcpy(ifan->ifan_name, ifp->if_xname,
 			sizeof(ifan->ifan_name));
 		ifan->ifan_what = what;
-	} else
-		printf("rtsock.c: rt_makeifannouncemsg(), m == NULL!\n");
+	}
+
 	return m;
 }
 
@@ -1248,8 +1236,6 @@
 
 	switch (direction) {
 	case SND_IN:
-		printf("rtsock.c: rt_securendmsg(), SND_IN\n");
-
 		/* Incoming traffic sent to userspace for SeND validation. */
 		m = rt_makeifannouncemsg(ifp, RTM_SND, RTM_SND_IN, &info);
 		break;
@@ -1259,15 +1245,12 @@
 		break;
 	}
 
-	printf("rtsock.c: rt_securendmsg(), after rt_makeifannouncemsg\n");
 	rt_msg3(m, data, data_len);
-	printf("rtsock.c: rt_securendmsg(), after rt_msg3\n");
 }
 
 void
 rt_msg3(struct mbuf *m, void *data, size_t data_len)
 {
-	printf("rtsock.c: rt_msg3()\n");
 
 	if (m != NULL) {
 		/*
@@ -1283,30 +1266,21 @@
 		if (data_len > M_TRAILINGSPACE(m)) {
 			struct mbuf *n = m_get(M_NOWAIT, MT_DATA);
 			if (n == NULL) {
-				printf("rtsock.c: rt_msg3(), m_freem!\n");
 				m_freem(m);
 				return;
 			}
-			printf("rtsock.c: rt_msg3(), prije bcopy!\n");
 			bcopy(data, mtod(n, void *), data_len);
 			printf("rtsock.c: rt_msg3(), nakon bcopy!\n");
 			n->m_len = data_len;
-			printf("Nakon n->m_len = data_len = %zu;\n", data_len);
 			m->m_next = n;
-			printf("Nakon m->m_next = n;\n");
 		} else if (data_len > 0) {
-			printf("rtsock.c: rt_msg3(), prije bcopy 2!\n");
-			printf("data_len = %zu\n", data_len);
 			bcopy(data, mtod(m, u_int8_t *) + m->m_len, data_len);
-			printf("rtsock.c: rt_msg3(), nakon bcopy 2!\n");
 			m->m_len += data_len;
 		}
 		if (m->m_flags & M_PKTHDR)
 			m->m_pkthdr.len += data_len;
 #endif
-		printf("prije mtod!\n");
 		mtod(m, struct if_announcemsghdr *)->ifan_msglen += data_len;
-		printf("prije rt_dispatch\n");
 		rt_dispatch(m, NULL);
 	}
 }

==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/icmp6.c#23 (text+ko) ====

@@ -824,9 +824,6 @@
 		break;
 
 	case ND_NEIGHBOR_SOLICIT:
-		printf("icmp6.c: ND_NEIGHBOR_SOLICIT!\n");
-		printf("icmp6.c: ip6len = %d\n", ip6len);
-		printf("icmp6.c: icmp6len = %d\n", icmp6len);
 		icmp6_ifstat_inc(ifp, ifs6_in_neighborsolicit);
 		if (code != 0)
 			goto badcode;
@@ -2146,8 +2143,6 @@
 	struct ifnet *outif = NULL;
 	struct in6_addr origdst, src, *srcp = NULL;
 
-	printf("%s %d\n", __FUNCTION__, __LINE__);
-
 	/* too short to reflect */
 	if (off < sizeof(struct ip6_hdr)) {
 		nd6log((LOG_DEBUG,
@@ -2552,8 +2547,6 @@
 	struct ifnet *outif = NULL;
 	struct sockaddr_in6 src_sa;
 
-	printf("%s %d\n", __FUNCTION__, __LINE__);
-
 	icmp6_errcount(&V_icmp6stat.icp6s_outerrhist, ND_REDIRECT, 0);
 
 	/* if we are not router, we don't send icmp6 redirect */

==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#18 (text+ko) ====

@@ -1691,7 +1691,6 @@
     struct sockaddr_in6 *dst, struct rtentry *rt0)
 {
 
-	printf("%s %d\n", __FUNCTION__, __LINE__);
 	return (nd6_output_lle(ifp, origifp, m0, dst, rt0, NULL, NULL));
 }
 
@@ -1720,8 +1719,6 @@
 	int ip6len, skip = 0;
 	unsigned short *nd_type;
 
-	printf("%s %d\n", __FUNCTION__, __LINE__);
-
 	ip6 = mtod(m, struct ip6_hdr *);
 	ip6len = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen);	
 
@@ -1905,7 +1902,6 @@
 		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, SND_OUT, ip6len);
 		} else
@@ -1953,7 +1949,6 @@
 		    NULL));
 	}
 	error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, NULL);
-	printf("%s %d: nakon if_output()\n", __FUNCTION__, __LINE__);
 
 	return (error);
 
@@ -2052,8 +2047,6 @@
 {
 	struct llentry *ln;
 
-	printf("nd6_storelladdr\n");
-
 	*lle = NULL;
 	IF_AFDATA_UNLOCK_ASSERT(ifp);
 	if (m->m_flags & M_MCAST) {
@@ -2070,7 +2063,6 @@
 #endif
 		case IFT_BRIDGE:
 		case IFT_ISO88025:
-			printf("nd6_storelladdr, IFT_ETHER\n");
 			ETHER_MAP_IPV6_MULTICAST(&SIN6(dst)->sin6_addr,
 						 desten);
 			return (0);
@@ -2095,23 +2087,15 @@
 	/*
 	 * 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)) {
-		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);
 	}

==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6_nbr.c#10 (text+ko) ====

@@ -401,8 +401,6 @@
 
 	bzero(&ro, sizeof(ro));
 
-	printf("%s %d\n", __FUNCTION__, __LINE__);
-
 	if (IN6_IS_ADDR_MULTICAST(taddr6))
 		return;
 
@@ -575,8 +573,6 @@
 			M_NOWAIT);
 		if (mtag == NULL)
 			goto bad;
-		else
-			printf("%s: PACKET_TAG_ND_OUTGOING added.\n", __FUNCTION__);
 		*(unsigned short *)(mtag + 1) = nd_ns->nd_ns_type;
 		m_tag_prepend(m, mtag); 
 	}
@@ -963,8 +959,6 @@
 
 	bzero(&ro, sizeof(ro));
 
-	printf("%s %d\n", __FUNCTION__, __LINE__);
-
 	daddr6 = *daddr6_0;	/* make a local copy for modification */
 
 	/* estimate the size of message */

==== //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#29 (text+ko) ====

@@ -33,8 +33,6 @@
 	int icmp6len; 
 	int offp;
 
-	printf("send.c: send_output()\n");
-
 	/* 
 	 * Receive incoming (SEND-protected) or outgoing traffic  
 	 * (SEND-validated) from the SEND user space application.
@@ -90,7 +88,6 @@
 			nd6_ra_input(m, sizeof(struct ip6_hdr), icmp6len);
 			break;
 		default:
-			/* XXX-BZ TODO */
 			printf("%s:%d: icmp6_code=%u\n",
 			    __func__, __LINE__, icmp6->icmp6_code);
 			m_print(m, m->m_pkthdr.len);
@@ -116,11 +113,6 @@
 		if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst))
 			m->m_flags |= M_MCAST;
 
-                {
-			char ip6buf[INET6_ADDRSTRLEN];
-			printf("XXX-AK %s: ifp=%p, xname=%s, ip6->ip6_dst=%s\n", __func__, ifp, ifp->if_xname, ip6_sprintf(ip6buf, &ip6->ip6_dst));
-                }
-
 		bzero(&dst, sizeof(dst));
         	dst.sin6_family = AF_INET6;
         	dst.sin6_len = sizeof(dst);


More information about the p4-projects mailing list