netlink socket correct check (#15720)

This commit is contained in:
gaurav
2020-05-07 09:55:31 +02:00
committed by GitHub
parent f5b7d681c7
commit 48a3b5c6db
+1 -1
View File
@@ -283,7 +283,7 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *ret_mcast_gr
struct cmsghdr *cmsg;
cmsg = cmsg_find(&msg, SOL_NETLINK, NETLINK_PKTINFO, CMSG_LEN(sizeof(struct nl_pktinfo)));
if (ret_mcast_group)
if (cmsg)
*ret_mcast_group = ((struct nl_pktinfo*) CMSG_DATA(cmsg))->group;
else
*ret_mcast_group = 0;