mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-01 09:42:39 +00:00
Fix ss if INET_DIAG not enabled in kernel
If kernel doesn't have INET_DIAG and using newish version of iproute nothing would be displayed.
This commit is contained in:
parent
ff24746cca
commit
930a75f925
@ -1534,8 +1534,10 @@ static int tcp_show_netlink(struct filter *f, FILE *dump_fp, int socktype)
|
||||
.msg_iovlen = f->f ? 3 : 1,
|
||||
};
|
||||
|
||||
if (sendmsg(fd, &msg, 0) < 0)
|
||||
if (sendmsg(fd, &msg, 0) < 0) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
iov[0] = (struct iovec){
|
||||
.iov_base = buf,
|
||||
@ -1589,6 +1591,10 @@ static int tcp_show_netlink(struct filter *f, FILE *dump_fp, int socktype)
|
||||
fprintf(stderr, "ERROR truncated\n");
|
||||
} else {
|
||||
errno = -err->error;
|
||||
if (errno == EOPNOTSUPP) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
perror("TCPDIAG answers");
|
||||
}
|
||||
close(fd);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user