monitor: Fix issue with enabling PACKET_MR_ALLMULTI option

This commit is contained in:
Marcel Holtmann 2014-08-09 13:03:30 -07:00
parent da5841201e
commit df718dda94
1 changed files with 3 additions and 5 deletions

View File

@ -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);