PERFORCE change 167177 for review

Gabor Pali pgj at FreeBSD.org
Mon Aug 10 14:53:38 UTC 2009


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

Change 167177 by pgj at petymeg-current on 2009/08/10 14:53:23

	Add a default value for network interface, when no interface
	exists for a given route.

Affected files ...

.. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat_route.c#3 edit

Differences ...

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

@@ -288,9 +288,10 @@
 	rtp->rt_gateway = extract_address(rte->rt_gateway, NULL, RTF_HOST);
 	rtp->rt_refs = rte->rt_refcnt;
 	rtp->rt_used = rte->rt_use;
-	if (rte->rt_ifp != NULL) {
+	if (rte->rt_ifp != NULL)
 		rtp->rt_interface = strdup(rte->rt_ifp->if_xname);
-	}
+	else
+		rtp->rt_interface = strdup("---");
 	if (rte->rt_rmx.rmx_expire > 0) {
 		if (clock_gettime(CLOCK_UPTIME, &uptime) < 0) {
 			warn("netstat_route: clock_gettime() failed");


More information about the p4-projects mailing list