PERFORCE change 165613 for review

Ana Kukec anchie at FreeBSD.org
Sat Jul 4 22:53:58 UTC 2009


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

Change 165613 by anchie at anchie_malimis on 2009/07/04 22:53:22

	Minor bug fix.	

Affected files ...

.. //depot/projects/soc2009/anchie_send/send_0.2/sendd/net.c#12 edit
.. //depot/projects/soc2009/anchie_send/send_0.2/sendd/sendd.c#9 edit

Differences ...

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

@@ -117,11 +117,9 @@
 	struct snd_ifinfo *p;
 
 	list_for_each_entry(p, &ifaces, list) {
-		DBG(&dbg_snd, "*maxfd = %d, p->snds = %d", *maxfd, p->snds);
 		*maxfd = *maxfd > p->snds ? *maxfd : p->snds;
 		p->snds = sock;
 		FD_SET(p->snds, fds);
-		applog(LOG_ERR, "snds added to snd_ifinfo.");
 	}
 }
 
@@ -194,7 +192,7 @@
 }
 
 void
-snd_sock_read(void)
+snd_sock_read()
 {
 	struct rt_msghdr *rtm;
 	struct if_announcemsghdr *ifan;
@@ -205,6 +203,7 @@
 		return;
 	}
 
+	applog(LOG_ERR, "sndsock prije read = %d", sndsock);
 	n = read(sndsock, b, sizeof(b));
 	if (n < 0) {
 		applog(LOG_ERR, "%s: read: %s", __FUNCTION__, strerror(errno));
@@ -312,7 +311,7 @@
 }
 
 int
-snd_net_init(int *icmp6sock, int *sndsock)
+snd_net_init(int *icmp6socket, int *sndsocket)
 {
 	int v;
 	struct icmp6_filter filter;
@@ -327,13 +326,13 @@
 	}
 #endif
 
-	if ((*icmp6sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) {
+	if ((*icmp6socket = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) {
 		applog(LOG_ERR, "%s: socket: %s", __FUNCTION__,
 		       strerror(errno));
 		return (-1);
 	}
 
-	if ((*sndsock = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) {
+	if ((*sndsocket = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) {
 		applog(LOG_ERR, "%s: socket: %s", __FUNCTION__,
 			strerror(errno));
 		return(-1);
@@ -341,17 +340,18 @@
 		applog(LOG_ERR, "%s: routing socket created.", __FUNCTION__);
 	}  
 
-	applog(LOG_ERR, "*icmp6sock = %d, *sndsock = %d", *icmp6sock, *sndsock);
+	icmp6sock = *icmp6socket;
+	sndsock = *sndsocket;
 
 	v = 255;
-	if (setsockopt(*icmp6sock, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &v,
+	if (setsockopt(icmp6sock, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &v,
 		       sizeof (v)) < 0) {
 		applog(LOG_ERR, "%s: setsockopt(IPV6_UNICAST_HOPS): %s",
 		       __FUNCTION__, strerror(errno));
 		return (-1);
 	}
 	v = 255;
-	if (setsockopt(*icmp6sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &v,
+	if (setsockopt(icmp6sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &v,
 	    sizeof (v)) < 0) {
 		applog(LOG_ERR, "%s: setsockopt(IPV6_MULTICAST_HOPS): %s",
 		       __FUNCTION__, strerror(errno));
@@ -363,7 +363,7 @@
 	ICMP6_FILTER_SETPASS(ICMP6_SND_CPA, &filter);
 	ICMP6_FILTER_SETPASS(ND_ROUTER_ADVERT, &filter);
 
-	if (setsockopt(*icmp6sock, IPPROTO_ICMPV6, ICMP6_FILTER, &filter,
+	if (setsockopt(icmp6sock, IPPROTO_ICMPV6, ICMP6_FILTER, &filter,
 		       sizeof (filter)) < 0) {
 		applog(LOG_ERR, "%s: setsockopt(ICMP6_FILTER): %s",
 		       __FUNCTION__, strerror(errno));

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



More information about the p4-projects mailing list