jvinet / knock

A port-knocking daemon
http://www.zeroflux.org/projects/knock
GNU General Public License v2.0
552 stars 114 forks source link

knock 0.7.7 does not compile on Centos 6.7 #33

Closed jalbstmeijer closed 8 years ago

jalbstmeijer commented 8 years ago

make

make all-am make[1]: Entering directory /tmp/knock-0.7.7' depbase=echo src/knockd.o | sed 's|[^/]_$|.deps/&|;s|.o$||';\ gcc -DHAVE_CONFIG_H -I. -D_DEFAULT_SOURCE -g -Wall -pedantic -fno-exceptions -g -O2 -MT src/knockd.o -MD -MP -MF $depbase.Tpo -c -o src/knockd.o src/knockd.c &&\ mv -f $depbase.Tpo $depbase.Po src/knockd.c:22:1: warning: C++ style comments are not allowed in ISO C90 src/knockd.c:22:1: warning: (this will be reported only once per input file) src/knockd.c: In function ‘flags_match’: src/knockd.c:1292: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c:1292: error: ‘TH_FIN’ undeclared (first use in this function) src/knockd.c:1292: error: (Each undeclared identifier is reported only once src/knockd.c:1292: error: for each function it appears in.) src/knockd.c:1296: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c:1302: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c:1302: error: ‘TH_SYN’ undeclared (first use in this function) src/knockd.c:1306: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c:1312: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c:1312: error: ‘TH_RST’ undeclared (first use in this function) src/knockd.c:1316: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c:1322: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c:1322: error: ‘TH_PUSH’ undeclared (first use in this function) src/knockd.c:1326: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c:1332: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c:1332: error: ‘TH_ACK’ undeclared (first use in this function) src/knockd.c:1336: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c:1342: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c:1342: error: ‘TH_URG’ undeclared (first use in this function) src/knockd.c:1346: error: ‘struct tcphdr’ has no member named ‘th_flags’ src/knockd.c: In function ‘sniff’: src/knockd.c:1495: error: ‘struct tcphdr’ has no member named ‘th_sport’ src/knockd.c:1496: error: ‘struct tcphdr’ has no member named ‘th_dport’ src/knockd.c:1501: error: ‘struct udphdr’ has no member named ‘uh_sport’ src/knockd.c:1502: error: ‘struct udphdr’ has no member named ‘uh_dport’ make[1]: *_\* [src/knockd.o] Error 1 make[1]: Leaving directory/tmp/knock-0.7.7' make: *\ [all] Error 2

airwoflgh commented 8 years ago

Taking a look and will revert.

thedolphin commented 8 years ago

CFLAGS="-D_BSD_SOURCE" ./configure will solve issue.

In RPM spec:

export CFLAGS="-D_BSD_SOURCE"
%configure
jalbstmeijer commented 8 years ago

Works for me, thank you

thedolphin commented 8 years ago

Also look at #36

airwoflgh commented 8 years ago

Confirmed on CFLAGS. Already had it set on my test system so didn't catch it. Apologies.

airwoflgh commented 8 years ago

Pull request back to master raised.