mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-30 03:08:59 +00:00
lib: fix getsockopt_cmsg_data retrieval
The `type` parameter was not being compared with `cmsg_type`, so the result of this function was always a pointer to the first header matching the level. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
aa0b1d3b60
commit
dc094865db
@ -75,7 +75,7 @@ static void *getsockopt_cmsg_data(struct msghdr *msgh, int level, int type)
|
|||||||
|
|
||||||
for (cmsg = ZCMSG_FIRSTHDR(msgh); cmsg != NULL;
|
for (cmsg = ZCMSG_FIRSTHDR(msgh); cmsg != NULL;
|
||||||
cmsg = CMSG_NXTHDR(msgh, cmsg))
|
cmsg = CMSG_NXTHDR(msgh, cmsg))
|
||||||
if (cmsg->cmsg_level == level && cmsg->cmsg_type)
|
if (cmsg->cmsg_level == level && cmsg->cmsg_type == type)
|
||||||
return (ptr = CMSG_DATA(cmsg));
|
return (ptr = CMSG_DATA(cmsg));
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user