[PATCH] Patch for bug 11714: Listening for network interface changes doesn't work
Ralph Boehme <rb <at> sernet.de>
2016-02-04 17:20:20 GMT
winbindd is watching for network interface address changes by virtue
of our addrchange_send/recv() API that uses netlink to query the
kernel for this information.
[2016/02/04 11:43:31.723123, 10, pid=17692, effective(0, 0), real(0,0)] ../source3/lib/addrchange.c:154(addrchange_done)
tdgram_recvfrom_recv returned Operation not supported
[2016/02/04 11:43:31.723176, 10, pid=17692, effective(0, 0), real(0,0), class=winbind] ../source3/winbindd/winbindd.c:1486(winbindd_addr_changed)
addrchange_recv failed: NT_STATUS_NOT_SUPPORTED, stop listening
strace shows a failing ioctl(fd, FIONREAD, ...) returning
EOPNOTSUPP. We use the ioctl to determine the amount of pending data
so we can allocate an appropriate buffer.
This is a regression introduced in 0d161e42d9aeb155eae2b04eccec497b21de8029.
What can we do?
We could use MSG_PEEK, but that's not portable and we'd have to call
recvmsg() twice every time the fd is reported readable.
As a band aid, allocate a laaaarge buffer and watch out for MSG_TRUNC
We could also revert 0d161e42d9aeb155eae2b04eccec497b21de8029 and fix