diff --git a/misc/ss.c b/misc/ss.c index 68bffe28..1f4a30f7 100644 --- a/misc/ss.c +++ b/misc/ss.c @@ -2199,6 +2199,8 @@ static int inet_show_netlink(struct filter *f, FILE *dump_fp, int protocol) return -1; rth.dump = MAGIC_SEQ; rth.dump_fp = dump_fp; + if (preferred_family == PF_INET6) + family = PF_INET6; again: if ((err = sockdiag_send(family, rth.fd, protocol, f))) @@ -2211,7 +2213,7 @@ again: } goto Exit; } - if (family == PF_INET) { + if (family == PF_INET && preferred_family != PF_INET) { family = PF_INET6; goto again; }