[Click] Mac OS X assert failed when trying to use KernelTun
Pekka Nikander
pekka.nikander at nomadiclab.com
Fri Nov 20 10:14:10 EST 2009
I'm a relative newbie to Click, and trying to use KernelTun on Mac OS X, with the latest GIT version. Unfortunately it looks like that there is a bug, apparently related to the interactions between kevents and select/poll.
The OS X tun/tap devices don't currently support kevents, and therefore click tries to back off to use select/poll. However, once it gets to the actual poll in master.cc, something has gone wrong and I get a an assertion failure on line 850 in master.cc:
Element *read_elt = (p->revents & ~POLLOUT ? _read_elements[fd] : 0);
This results in an assertion failure, with this trivial script:
click -e "KernelTun(192.168.15.1/24) -> Discard"
Assertion failed: (i>=0 && i<_n), function operator[], file ../include/click/vector.hh, line 184.
Abort trap
My gut feeling is that the bug may line somewhere in master.cc Master:add_select, in the code that tries to make sure that one can fall back to select/poll in the case of kqueue error. But I may be wrong.
In any case, when tracing the execution in opening the tun/tap device, the kevent system call at line 602 of master.cc fails, causing the _kqueue socket to be closed and made unused. However, much before that I can see with ifconfig that the tun/tap interface is indeed open and correctly ifconfig'ed.
Anyone an idea where to continue debugging? Or would it be easier to add KEVENT support to the Mac tun/tap kexts?
--Pekka Nikander
More information about the click
mailing list