Date: Sat, 4 Jul 2009 22:33:34 GMT From: Gabor Pali <pgj@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 165612 for review Message-ID: <200907042233.n64MXYAL046581@repoman.freebsd.org>
index | next in thread | raw e-mail
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:help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907042233.n64MXYAL046581>
