From owner-p4-projects@FreeBSD.ORG Sat Jul 4 22:33:36 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3FDE01065674; Sat, 4 Jul 2009 22:33:35 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F406A1065672 for ; Sat, 4 Jul 2009 22:33:34 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E2E068FC0A for ; Sat, 4 Jul 2009 22:33:34 +0000 (UTC) (envelope-from pgj@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n64MXY3o046583 for ; Sat, 4 Jul 2009 22:33:34 GMT (envelope-from pgj@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n64MXYAL046581 for perforce@freebsd.org; Sat, 4 Jul 2009 22:33:34 GMT (envelope-from pgj@FreeBSD.org) Date: Sat, 4 Jul 2009 22:33:34 GMT Message-Id: <200907042233.n64MXYAL046581@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to pgj@FreeBSD.org using -f From: Gabor Pali To: Perforce Change Reviews Cc: Subject: PERFORCE change 165612 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, 04 Jul 2009 22:33:36 -0000 http://perforce.freebsd.org/chv.cgi?CH=165612 Change 165612 by pgj@petymeg-current on 2009/07/04 22:33:33 - Fix filtering of inet lists extracted from kernel images - Fix generation of symbols lists Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.c#40 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/lib/libnetstat/netstat.c#40 (text+ko) ==== @@ -414,6 +414,33 @@ if (inp->inp_gencnt > pcbinfo.ipi_gencnt) continue; + if (((inp->inp_vflag & INP_IPV4) == 0) +#ifdef INET6 + && ((inp->inp_vflag & INP_IPV6) == 0) +#endif + ) + continue; + +#ifdef INET6 + if ((family == PF_INET && ((inp->inp_vflag & INP_IPV4) == 0)) || + (family == PF_INET6 && ((inp->inp_vflag & INP_IPV6) == 0))) + continue; +#endif + + if ((flags & NETSTAT_SOCKET_ALL) == 0 && + ( + (protocol == IPPROTO_TCP && + inp->inp_ppcb != NULL && + ((struct tcpcb *)inp->inp_ppcb)->t_state == TCPS_LISTEN) + || ((inp->inp_vflag & INP_IPV4) != 0 && + inet_lnaof(inp->inp_laddr) == INADDR_ANY) +#ifdef INET6 + || ((inp->inp_vflag & INP_IPV6) != 0 && + IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) +#endif + )) + continue; + if (protocol == IPPROTO_TCP) { if (inp->inp_ppcb == NULL) bzero(&xt.xt_tp, sizeof(xt.xt_tp)); @@ -571,7 +598,8 @@ nls[nlUNP_MAX].n_name = NULL; for (i = nlUNP_MAX + 1; i < (nlUNP_MAX + 1 + nlINP_MAX + 1); i++) - nls[i].n_name = strdup(inp_symbol[i]); + nls[i].n_name = strdup(inp_symbol[i - + (nlUNP_MAX + 1)]); nls[nlUNP_MAX + 1 + nlINP_MAX].n_name = NULL; break; case PF_LOCAL: