Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jul 2005 00:07:19 GMT
From:      soc-anders <soc-anders@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 80821 for review
Message-ID:  <200507230007.j6N07JEe050765@repoman.freebsd.org>

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

Change 80821 by soc-anders@soc-anders_gimli on 2005/07/23 00:06:36

	IPsec6 stats are now available

Affected files ...

.. //depot/projects/soc2005/ifcleanup/src/src/usr.bin/netstat/ipsec.c#3 edit

Differences ...

==== //depot/projects/soc2005/ifcleanup/src/src/usr.bin/netstat/ipsec.c#3 (text+ko) ====

@@ -238,18 +238,18 @@
 ipsec_stats(u_long off __unused, const char *name, int af1 __unused)
 {
 	size_t len;
+	char *mib;
+	printf ("%s:\n", name);
 
-	printf ("%s:\n", name);
+	if (strcmp(name, "ipsec") == 0)
+		mib = "net.inet.ipsec.stats";
+	else
+		mib = "net.inet6.ipsec6.stats";
 
-	if (strcmp(name, "ipsec") == 0) {
-		len = sizeof(ipsecstat);
-		if (sysctlbyname("net.inet.ipsec.stats", &ipsecstat, &len,
-				 NULL, 0) < 0) {
-			warn("sysctl: net.inet.ipsec.stats");
-			return;
-		}
-	} else {
-		/* IFCLEANUP: Not yet available */	   
+       	len = sizeof(ipsecstat);
+	if (sysctlbyname(mib, &ipsecstat, &len,
+			 NULL, 0) < 0) {
+		warn("sysctl: net.inet.ipsec.stats");
 		return;
 	}
 	print_ipsecstats();



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