russdill/tunsocks

'make' encounter error

luckypoem opened this issue · 5 comments

hi.

yudeMacBook-Air:tunsocks-by-russdill brite$ make
depbase=echo lwip-udhcpd/dhcpd.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';
gcc -DPACKAGE_NAME="tunsocks" -DPACKAGE_TARNAME="tunsocks" -DPACKAGE_VERSION="1.0" -DPACKAGE_STRING="tunsocks\ 1.0" -DPACKAGE_BUGREPORT="russ.dill@gmail.com" -DPACKAGE_URL="https://github.com/russdill/tunsocks\" -DPACKAGE="tunsocks" -DVERSION="1.0" -DHAVE_PCAP=1 -I. -I./lwip/src/include -I./lwip/src/include/ipv4 -I./lwip/src/include/ipv6 -I./lwip-libevent/include -I./lwip-udhcpd -I./lwip-nat/include -I./include -Wall -Og -g -DUSE_PCAP -g -O2 -MT lwip-udhcpd/dhcpd.o -MD -MP -MF $depbase.Tpo -c -o lwip-udhcpd/dhcpd.o lwip-udhcpd/dhcpd.c &&
mv -f $depbase.Tpo $depbase.Po
lwip-udhcpd/dhcpd.c:24:10: fatal error: 'netinet/ether.h' file not found
#include <netinet/ether.h>
^
1 error generated.
make: *** [lwip-udhcpd/dhcpd.o] Error 1
yudeMacBook-Air:tunsocks-by-russdill brite$

how to fix it?

It's left over from the udhcp port. Just remove the offending line and you should be fine.

hi.
i removed the line: #include <netinet/ether.h> from dhcpd.c ,then i ran "make" again,but encountered another error:

yudeMacBook-Air:tunsocks-by-russdill brite$ make
it shows:
...
lwip-libevent/netif/slirpif_udp.c:130:40: error: use of undeclared identifier
'SOCK_NONBLOCK'
fd = socket(sa.sa_family, SOCK_DGRAM|SOCK_NONBLOCK, IPPR...
^
1 error generated.
make: *** [lwip-libevent/netif/slirpif_udp.o] Error 1
yudeMacBook-Air:tunsocks-by-russdill brite$

how to fix it?

Looks like there are some more linux'isms lurking. You'll have to do some work cleaning them up for it to compile.

hi.

i removed line 130 from lwip-libevent/netif/slirpif_udp.c ,and "make" again, encountered another error:
...
lwip-libevent/netif/udptapif.c:273:34: error: use of undeclared identifier 'SOCK_NONBLOCK'
fd = socket(AF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_UDP);
^
2 warnings and 1 error generated.
make: *** [lwip-libevent/netif/udptapif.o] Error 1

i removed line 273 from lwip-libevent/netif/udptapif.c ,and "make" again, encountered another error:

it shows:
...
lwip-libevent/netif/tunif.c:9:10: fatal error: 'linux/if_tun.h' file not found
#include <linux/if_tun.h>
^
1 error generated.
make: *** [lwip-libevent/netif/tunif.o] Error 1

does this error:"fatal error: 'linux/if_tun.h' file not found" mean that i cannot solve it at all?
bcoz there is no if_tun.h file in mac os x?