From owner-p4-projects@FreeBSD.ORG Sat Jul 23 00:07:20 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 60DE016A421; Sat, 23 Jul 2005 00:07:20 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BAEB16A41F for ; Sat, 23 Jul 2005 00:07:20 +0000 (GMT) (envelope-from soc-anders@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CBF143D49 for ; Sat, 23 Jul 2005 00:07:20 +0000 (GMT) (envelope-from soc-anders@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j6N07J1o050768 for ; Sat, 23 Jul 2005 00:07:19 GMT (envelope-from soc-anders@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j6N07JEe050765 for perforce@freebsd.org; Sat, 23 Jul 2005 00:07:19 GMT (envelope-from soc-anders@freebsd.org) Date: Sat, 23 Jul 2005 00:07:19 GMT Message-Id: <200507230007.j6N07JEe050765@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-anders@freebsd.org using -f From: soc-anders To: Perforce Change Reviews Cc: Subject: PERFORCE change 80821 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2005 00:07:21 -0000 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();