lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 19 Aug 2008 15:39:56 +0800
From:	Li Yewang <lyw@...fujitsu.com>
To:	shemminger@...ux-foundation.org
CC:	"'Netdev'" <netdev@...r.kernel.org>
Subject: [PATCH][iproute2/ss]distinguish the inet and inet6 domain when loading
 the tcp_diag module

When load the tcp_diag module, and use "ss -f inet" command to show the socket 
information of inet domain. But this command also shows the information of inet6 
domain, but not only inet domain. and "ss -f inet6", "ss -4", "ss -6" have the
same problem.


Signed-off-by: Li Yewang <lyw@...fujitsu.com>

diff --git a/misc/ss.c b/misc/ss.c
index 38eed29..dea90b6 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -1503,6 +1503,7 @@ static int tcp_show_netlink(struct filter *f, FILE 
*dump_fp, int socktype)
  		h = (struct nlmsghdr*)buf;
  		while (NLMSG_OK(h, status)) {
  			int err;
+			struct inet_diag_msg *r = NLMSG_DATA(h);

  			if (/*h->nlmsg_pid != rth->local.nl_pid ||*/
  			    h->nlmsg_seq != 123456)
@@ -1521,6 +1522,10 @@ static int tcp_show_netlink(struct filter *f, FILE 
*dump_fp, int socktype)
  				return 0;
  			}
  			if (!dump_fp) {
+				if (!(f->families & (1<<r->idiag_family))) {
+					h = NLMSG_NEXT(h, status);
+					continue;
+				}
  				err = tcp_show_sock(h, NULL);
  				if (err < 0)
  					return err;

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ