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
Richard Cochran 2018-02-28 23:37:47 -08:00
parent ae28894814
commit b01e84af98
1 changed files with 1 additions and 0 deletions

1
raw.c
View File

@ -103,6 +103,7 @@ static int raw_configure(int fd, int event, int index,
option = enable ? PACKET_ADD_MEMBERSHIP : PACKET_DROP_MEMBERSHIP;
memset(&mreq, 0, sizeof(mreq));
mreq.mr_ifindex = index;
mreq.mr_type = PACKET_MR_MULTICAST;
mreq.mr_alen = MAC_LEN;