From df718dda94bee449519cd82b565d1e25d641569b Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 9 Aug 2014 13:03:30 -0700 Subject: [PATCH] monitor: Fix issue with enabling PACKET_MR_ALLMULTI option --- monitor/nlmon.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index 9350a3a4..32fa3550 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -1178,12 +1178,10 @@ static struct l_io *open_packet(const char *name) mr.mr_type = PACKET_MR_ALLMULTI; if (setsockopt(fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP, - &mr, sizeof(mr) < 0)) { + &mr, sizeof(mr)) < 0) { perror("Failed to enable all multicast"); - if (errno != EINVAL) { - close(fd); - return NULL; - } + close(fd); + return NULL; } io = l_io_new(fd);