coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
516 stars 258 forks source link

Incorrect usage of setsockopt TCP_NODELAY #357

Closed Piscolero closed 7 years ago

Piscolero commented 7 years ago

The function net_open_eth() in src/net.c calls setsockopt with level SOL_SOCKET and option TCP_NODELAY. If you want to set TCP_NODELAY, the level has to be IPPROTO_TCP. The call now actually sets SO_DEBUG.

jobezic commented 7 years ago

Can you make a pull request, please?

matahr commented 7 years ago

Kernel 4.10.0-22-generic #24-Ubuntu SMP x86_64 GNU/Linux

chilli[21080]: 92 setsockopt(s=2, level=6, optname=1, optlen=4) failed chilli[21080]: Failed to create dhcp listener on eth0

Piscolero commented 7 years ago

Well, it's probably returning ENOPROTOOPT in this case, because it's not a tcp socket. So I think the setting should be avoided at all since it never worked before.