PERFORCE change 164485 for review

Ana Kukec anchie at FreeBSD.org
Tue Jun 16 08:59:27 UTC 2009


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

Change 164485 by anchie at anchie_malimis on 2009/06/16 08:58:34

	Minor changes.	

Affected files ...

.. //depot/projects/soc2009/anchie_send/send_0.2/sendd/net.c#8 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/nd6.c#5 edit
.. //depot/projects/soc2009/anchie_send/src/sys/netinet6/send.h#8 edit

Differences ...

==== //depot/projects/soc2009/anchie_send/send_0.2/sendd/net.c#8 (text+ko) ====

@@ -178,16 +178,21 @@
 	struct rt_msghdr *rtm;
 	struct if_announcemsghdr *ifan;
 	struct ip6_hdr *ip6;
-	struct mbuf *m;
+	struct sbuff *b;
 	int in = -1;
 	
-	n = read(sndsock, buf, sizeof(buf));
+	if ((b = snd_get_buf()) == NULL) {
+		return;
+	}
+
+	n = read(sndsock, b, sizeof(b));
 	if (n < 0) {
 		applog(LOG_ERR, "%s: read: %s", __FUNCTION__, strerror(errno));
 		goto done;
 	}
+	b->len = n;
 
-	rtm = (struct rt_msghdr *) buf;
+	rtm = (struct rt_msghdr *) b;
 	if (rtm->rtm_version != RTM_VERSION) {
 		applog(LOG_ERROR, "%s: Unsupported routing message version.", __FUNCTION__);
 		goto done;
@@ -205,19 +210,16 @@
 
 			/* n = RTM hdr + m as passed to nd6_ns_input() */
 			m = (struct rt_msghdr *) &ifan[1];
-
 			/* ToDo: Extract ifidx. */
-			snd_recv_pkt(m, ifidx, in);		
+			snd_recv_pkt(b, ifidx, in);		
 			break;
 		case RTM_SND_OUT:
 			in = 0;
 
-			/* n = RTM hdr + ether_hdr + ip6_hdr + icmp6len == ND message (as sent to if_output()) */
+			/* n = RTM hdr + ip6_hdr + icmp6len == ND message (as sent to if_output()) */
 			m = (struct rt_msghdr *) &ifan[1];
-
 			/* ToDo: Extract ifidx. */
-			snd_recv_pkt(m, ifidx, in);
-
+			snd_recv_pkt(b, ifidx, in);
 			break;
 		}
 		break;
@@ -228,6 +230,7 @@
 
 done:
 	/* ToDo: Free memory! */
+	snd_put_buf(b);
 }
 
 /*

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

@@ -75,6 +75,7 @@
 #include <netinet6/nd6.h>
 #include <netinet/icmp6.h>
 #include <netinet6/vinet6.h>
+#include <netinet6/send.h>
 
 #include <sys/limits.h>
 
@@ -1945,13 +1946,14 @@
 	 *
 	 * if_output() routines together with previous chaining will be called from input hook. 
 	 */
-/*
+
+#if 0
 	if ((ifp->if_flags & IFF_LOOPBACK) != 0) {
 		return ((*ifp->if_output)(origifp, m, (struct sockaddr *)dst,
 		    NULL));
 	}
 	error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, NULL);
-*/
+#endif
 	return (error);
 
   bad:

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

@@ -1,12 +1,15 @@
 /* send.c */
-int	(*send_output_hook)(int, struct ifnet *, struct mbuf *, int, int);
+#if 0
+extern int	(*send_output_hook)(int, struct ifnet *, struct mbuf *, int);
+#endif
+extern int	(*send_input_hook)(void);
 
 /* Message formats for messages from ND to applications (sendd) via the 
  * routing socket. These messages are appended to an if_announcemsghdr 
  * structure.
  */
-struct snd_message_event {
-}
 
+#if 0
 #define RTM_SND_OUT	0	/* outgoing traffic sent to sendd */
 #define RTM_SND_IN	1	/* incoming traffic sent to sendd */
+#endif


More information about the p4-projects mailing list