PERFORCE change 164311 for review

Gabor Pali pgj at FreeBSD.org
Sun Jun 14 00:21:25 UTC 2009


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

Change 164311 by pgj at petymeg-current on 2009/06/14 00:21:14

	Fix a small bug

Affected files ...

.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.c#27 edit

Differences ...

==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.c#27 (text+ko) ====

@@ -673,30 +673,32 @@
 		    extract_inet_address(NETSTAT_ADDRTYPE_INET_LOCAL,
 			stp->st_name, &inp->inp_laddr, inp->inp_lport,
 			inp->inp_vflag & INP_ANONPORT);
+		stp->st_addrcnt += 1;
 	}
 #ifdef INET6
 	else if (inp->inp_vflag & INP_IPV6) {
 		stp->st_address[stp->st_addrcnt] =
 		    extract_inet6_address(NETSTAT_ADDRTYPE_INET6_LOCAL,
 			stp->st_name, &inp->in6p_laddr, inp->inp_lport);
+		stp->st_addrcnt += 1;
 	}
 #endif
-	stp->st_addrcnt += 1;
 	/* foreign address */
-	if (inp->inp_vflag & INP_IPV6) {
+	if (inp->inp_vflag & INP_IPV4) {
 		stp->st_address[stp->st_addrcnt] =
 		    extract_inet_address(NETSTAT_ADDRTYPE_INET_FOREIGN,
 			stp->st_name, &inp->inp_faddr, inp->inp_fport,
 			inp->inp_vflag & INP_ANONPORT);
+		stp->st_addrcnt += 1;
 	}
 #ifdef INET6
 	else if (inp->inp_vflag & INP_IPV6) {
 		stp->st_address[stp->st_addrcnt] =
 		    extract_inet6_address(NETSTAT_ADDRTYPE_INET6_FOREIGN,
 			stp->st_name, &inp->in6p_faddr, inp->inp_fport);
+		stp->st_addrcnt += 1;
 	}
 #endif
-	stp->st_addrcnt += 1;
 }
 
 struct addr_type *


More information about the p4-projects mailing list