mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-11-02 16:25:18 +00:00
Merge pull request #8470 from mjstapp/fix_nhrp_cov_socket
nhrpd: fix coverity warning about os_socket()
This commit is contained in:
commit
8b74cd9e6d
@ -60,7 +60,7 @@ int os_sendmsg(const uint8_t *buf, size_t len, int ifindex, const uint8_t *addr,
|
||||
.msg_iov = &iov,
|
||||
.msg_iovlen = 1,
|
||||
};
|
||||
int status;
|
||||
int status, fd;
|
||||
|
||||
if (addrlen > sizeof(lladdr.sll_addr))
|
||||
return -1;
|
||||
@ -72,7 +72,11 @@ int os_sendmsg(const uint8_t *buf, size_t len, int ifindex, const uint8_t *addr,
|
||||
lladdr.sll_halen = addrlen;
|
||||
memcpy(lladdr.sll_addr, addr, addrlen);
|
||||
|
||||
status = sendmsg(os_socket(), &msg, 0);
|
||||
fd = os_socket();
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
|
||||
status = sendmsg(fd, &msg, 0);
|
||||
if (status < 0)
|
||||
return -errno;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user