mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 08:32:45 +00:00
pimd: Fix SA warning
Restructure code to remove SA warning from clang build. For some reason, the Clang SA system thought that si.sin_port and si.sin_addr where not being set to anything. Fix this problem. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
fa8da98c26
commit
fb5d6e2f41
@ -335,16 +335,13 @@ int pim_socket_recvfromto(int fd, uint8_t *buf, size_t len,
|
|||||||
struct sockaddr_in si;
|
struct sockaddr_in si;
|
||||||
socklen_t si_len = sizeof(si);
|
socklen_t si_len = sizeof(si);
|
||||||
|
|
||||||
((struct sockaddr_in *) to)->sin_family = AF_INET;
|
memset (&si, 0, sizeof (si));
|
||||||
|
to->sin_family = AF_INET;
|
||||||
|
|
||||||
if (pim_socket_getsockname(fd, (struct sockaddr *) &si, &si_len) != PIM_SOCK_ERR_NONE) {
|
pim_socket_getsockname(fd, (struct sockaddr *) &si, &si_len);
|
||||||
((struct sockaddr_in *) to)->sin_port = ntohs(0);
|
|
||||||
((struct sockaddr_in *) to)->sin_addr.s_addr = ntohl(0);
|
to->sin_port = si.sin_port;
|
||||||
}
|
to->sin_addr = si.sin_addr;
|
||||||
else {
|
|
||||||
((struct sockaddr_in *) to)->sin_port = si.sin_port;
|
|
||||||
((struct sockaddr_in *) to)->sin_addr = si.sin_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tolen)
|
if (tolen)
|
||||||
*tolen = sizeof(si);
|
*tolen = sizeof(si);
|
||||||
|
Loading…
Reference in New Issue
Block a user