kohler/click — pull request #85 by kwi-dk (2013-05-17 17:07:38+00:00)
Title: ToDevice.u and configure bugfixes

In 3d46d1b5, a commit ostensibly adding METHOD NETMAP support to FromDevice.u/ToDevice.u, ToDevice.u was also updated to look for a matching FromDevice to determine its default METHOD (something it previously did only in one special case).

However, a bug was introduced, which is triggered if the methods enabled by `TODEVICE_ALLOW_*` and `FROMDEVICE_ALLOW_*` do not match, in which case a default METHOD can be selected that is only supported by FromDevice.u and not by ToDevice.u. This then causes ToDevice.u to silently drop packets.

For me, this situation was caused by an error in `./configure`, which passes arguments to GCC in the wrong order, causing misdetection of libpcap. To wit:

$ gcc --version
gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
[...]

$ gcc -o conftest -g -O2 -W -Wall conftest.c -lpcap
[no problems]

$ gcc -o conftest -g -O2 -W -Wall -lpcap conftest.c
/tmp/ccRCYCdM.o: In function `main':
/tmp/click2/conftest.c:148: undefined reference to `pcap_inject'
collect2: error: ld returned 1 exit status

This pull request solves both problems, and also documents how the default METHOD is chosen for ToDevice.u.