Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Aug 2009 13:25:36 GMT
From:      Ana Kukec <anchie@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 167170 for review
Message-ID:  <200908101325.n7ADPaHr034375@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=167170

Change 167170 by anchie@anchie_malimis on 2009/08/10 13:25:07

	Minor corrections.	

Affected files ...

.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/icmp6.c#19 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.c#21 edit

Differences ...

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

@@ -814,9 +814,12 @@
 			goto badcode;
 		if (icmp6len < sizeof(struct nd_neighbor_solicit))
 			goto badlen;
+#if 0
 		if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) {
+#endif
+		if ((n = m_dup(m, M_DONTWAIT)) == NULL) {
 
-			/* Send incoming SeND-protected/ND packet to user space. */
+			/* Send incoming SeND/ND packet to user space. */
 			if (send_input_hook != NULL) {
 				send_input_hook(m, ifp, SND_IN, ip6len);
 				return (IPPROTO_DONE);

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

@@ -19,7 +19,7 @@
 #include <netinet6/in6_var.h>
 
 static int
-send_output(struct mbuf *m, struct ifnet *ifp, int in)
+send_output(struct mbuf *m, struct ifnet *ifp, int direction)
 {
 	struct ip6_hdr *ip6;
 	struct sockaddr_in6 *dst;
@@ -34,7 +34,7 @@
 	 * Outgoing packets are sent out using if_output(). 
 	 */
 
-	switch (in) {
+	switch (direction) {
 	case SND_IN:
 		icmp6len = m->m_pkthdr.len - sizeof(struct ip6_hdr);	
 		printf("send_output: m_pkthdr.len = %d\n", m->m_pkthdr.len);
@@ -79,13 +79,16 @@
 		return (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, NULL);
 		//return (0);
 		break;
+
+	default:
+		panic("Must be either SND_IN or SND_OUT.");
 	}	
 
 	return (0);
 }
 
 static int
-send_input(struct mbuf *m, struct ifnet *ifp, int in, int msglen)
+send_input(struct mbuf *m, struct ifnet *ifp, int direction, int msglen)
 {
 	struct ip6_hdr *ip6;
 
@@ -97,7 +100,7 @@
 	/* 
 	 * Send incoming or outgoing traffic to the user space either to be
 	 * protected (outgoing) or validated (incoming) according to rfc3971. */
-	rt_securendmsg(ifp, in, ip6, msglen);
+	rt_securendmsg(ifp, direction, ip6, msglen);
 
 	return (0);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908101325.n7ADPaHr034375>