raw: Fix valgrind setsockopt warning.
Valgrind is nagging us, saying we pass uninitialized data through a setsockopt() call. This patch fixes the issue by clearing the entire passed structure. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
ae28894814
commit
b01e84af98
1
raw.c
1
raw.c
|
@ -103,6 +103,7 @@ static int raw_configure(int fd, int event, int index,
|
||||||
|
|
||||||
option = enable ? PACKET_ADD_MEMBERSHIP : PACKET_DROP_MEMBERSHIP;
|
option = enable ? PACKET_ADD_MEMBERSHIP : PACKET_DROP_MEMBERSHIP;
|
||||||
|
|
||||||
|
memset(&mreq, 0, sizeof(mreq));
|
||||||
mreq.mr_ifindex = index;
|
mreq.mr_ifindex = index;
|
||||||
mreq.mr_type = PACKET_MR_MULTICAST;
|
mreq.mr_type = PACKET_MR_MULTICAST;
|
||||||
mreq.mr_alen = MAC_LEN;
|
mreq.mr_alen = MAC_LEN;
|
||||||
|
|
Loading…
Reference in New Issue