af-packet: fix fanout support on Debian Jessie

Debian Jessie with kernel 3.16 would not accept the 'id' of 99 used
in the test. Id 1 does work.
pull/2440/head
Victor Julien 9 years ago
parent e492f0dc89
commit ab8faefd37

@ -1815,7 +1815,7 @@ int AFPIsFanoutSupported(void)
int fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); int fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
if (fd != -1) { if (fd != -1) {
uint16_t mode = PACKET_FANOUT_HASH | PACKET_FANOUT_FLAG_DEFRAG; uint16_t mode = PACKET_FANOUT_HASH | PACKET_FANOUT_FLAG_DEFRAG;
uint16_t id = 99; uint16_t id = 1;
uint32_t option = (mode << 16) | (id & 0xffff); uint32_t option = (mode << 16) | (id & 0xffff);
int r = setsockopt(fd, SOL_PACKET, PACKET_FANOUT,(void *)&option, sizeof(option)); int r = setsockopt(fd, SOL_PACKET, PACKET_FANOUT,(void *)&option, sizeof(option));
close(fd); close(fd);

Loading…
Cancel
Save