mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-04 17:19:43 +00:00
tipc/node: Fix socket fd check in cmd_node_get_addr()
socket() returns -1 on error, not 0. Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
parent
1e3197e0fd
commit
436270a45d
@ -109,7 +109,8 @@ static int cmd_node_get_addr(struct nlmsghdr *nlh, const struct cmd *cmd,
|
||||
socklen_t sz = sizeof(struct sockaddr_tipc);
|
||||
struct sockaddr_tipc addr;
|
||||
|
||||
if (!(sk = socket(AF_TIPC, SOCK_RDM, 0))) {
|
||||
sk = socket(AF_TIPC, SOCK_RDM, 0);
|
||||
if (sk < 0) {
|
||||
fprintf(stderr, "opening TIPC socket: %s\n", strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user