Merge branch 'master' into net-next
This commit is contained in:
commit
0562af4a07
25
misc/ss.c
25
misc/ss.c
|
|
@ -1059,12 +1059,25 @@ static void inet_addr_print(const inet_prefix *a, int port, unsigned int ifindex
|
||||||
ap = format_host(AF_INET, 4, a->data);
|
ap = format_host(AF_INET, 4, a->data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ap = format_host(a->family, 16, a->data);
|
if (!memcmp(a->data, &in6addr_any, sizeof(in6addr_any))) {
|
||||||
est_len = strlen(ap);
|
buf[0] = '*';
|
||||||
if (est_len <= addr_width)
|
buf[1] = 0;
|
||||||
est_len = addr_width;
|
} else {
|
||||||
else
|
ap = format_host(a->family, 16, a->data);
|
||||||
est_len = addr_width + ((est_len-addr_width+3)/4)*4;
|
|
||||||
|
/* Numeric IPv6 addresses should be bracketed */
|
||||||
|
if (strchr(ap, ':')) {
|
||||||
|
snprintf(buf, sizeof(buf),
|
||||||
|
"[%s]", ap);
|
||||||
|
ap = buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
est_len = strlen(ap);
|
||||||
|
if (est_len <= addr_width)
|
||||||
|
est_len = addr_width;
|
||||||
|
else
|
||||||
|
est_len = addr_width + ((est_len-addr_width+3)/4)*4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ifindex) {
|
if (ifindex) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue