Closed aloorpro closed 5 months ago
Looks like a bug where pcap isn't including the things it needs. I'm a bit busy, but I'll have a look next week.
Probably arping can work around this by including sys/types.h before pcap.h
Actually arping is already including sys/types.h
befor pcap.h
.
Could you share the output of ./configure
on your system, as well as config.log
?
sure, thanks config.log
Could you try adding this as the very first line of src/arping.c
, and try again?
#define _GNU_SOURCE
Output changed, here's some other pack of errors:
In file included from /builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:90:0,
from /builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap.h:43,
from fuzz_pingip.c:28:
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/bpf.h:85:9: error: unknown type name 'u_int'
typedef u_int bpf_u_int32;
^~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/bpf.h:105:2: error: unknown type name 'u_int'
u_int bf_len;
^~~~~
In file included from /builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:90:0,
from /builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap.h:43,
from fuzz_pingip.c:28:
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/bpf.h:235:2: error: unknown type name 'u_short'
u_short code;
^~~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/bpf.h:236:2: error: unknown type name 'u_char'
u_char jt;
^~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/bpf.h:237:2: error: unknown type name 'u_char'
u_char jf;
^~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/bpf.h:248:10: error: unknown type name 'u_int'
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
^~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/bpf.h:248:58: error: unknown type name 'u_char'
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
^~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/bpf.h:248:68: error: unknown type name 'u_int'; did you mean '__u_int'?
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
^~~~~
__u_int
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/bpf.h:248:75: error: unknown type name 'u_int'; did you mean '__u_int'?
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
^~~~~
__u_int
In file included from /builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap.h:43:0,
from fuzz_pingip.c:28:
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:165:2: error: unknown type name 'u_short'
u_short version_major;
^~~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:166:2: error: unknown type name 'u_short'
u_short version_minor;
^~~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:211:2: error: unknown type name 'u_int'
u_int ps_recv; /* number of packets received */
^~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:212:2: error: unknown type name 'u_int'
u_int ps_drop; /* number of packets dropped */
^~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:213:2: error: unknown type name 'u_int'
u_int ps_ifdrop; /* drops by interface -- only supported on some platforms */
^~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:286:30: error: unknown type name 'u_char'; did you mean '__u_char'?
typedef void (*pcap_handler)(u_char *, const struct pcap_pkthdr *,
^~~~~~
__u_char
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:287:15: error: unknown type name 'u_char'
const u_char *);
^~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:411:65: error: unknown type name 'u_int'; did you mean '__u_int'?
PCAP_API pcap_t *pcap_open_dead_with_tstamp_precision(int, int, u_int);
^~~~~
__u_int
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:412:72: error: unknown type name 'u_int'; did you mean '__u_int'?
PCAP_API pcap_t *pcap_open_offline_with_tstamp_precision(const char *, u_int, char *);
^~~~~
__u_int
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:437:69: error: unknown type name 'u_int'; did you mean '__u_int'?
PCAP_API pcap_t *pcap_fopen_offline_with_tstamp_precision(FILE *, u_int, char *);
^~~~~
__u_int
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:442:39: error: unknown type name 'pcap_handler'; did you mean 'pcap_addr_t'?
PCAP_API int pcap_loop(pcap_t *, int, pcap_handler, u_char *);
^~~~~~~~~~~~
pcap_addr_t
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:442:53: error: unknown type name 'u_char'; did you mean '__u_char'?
PCAP_API int pcap_loop(pcap_t *, int, pcap_handler, u_char *);
^~~~~~
__u_char
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:443:43: error: unknown type name 'pcap_handler'; did you mean 'pcap_addr_t'?
PCAP_API int pcap_dispatch(pcap_t *, int, pcap_handler, u_char *);
^~~~~~~~~~~~
pcap_addr_t
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:443:57: error: unknown type name 'u_char'; did you mean '__u_char'?
PCAP_API int pcap_dispatch(pcap_t *, int, pcap_handler, u_char *);
^~~~~~
__u_char
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:444:16: error: unknown type name 'u_char'
PCAP_API const u_char *pcap_next(pcap_t *, struct pcap_pkthdr *);
^~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:445:67: error: unknown type name 'u_char'
PCAP_API int pcap_next_ex(pcap_t *, struct pcap_pkthdr **, const u_char **);
^~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:453:46: error: unknown type name 'u_char'
PCAP_API int pcap_sendpacket(pcap_t *, const u_char *, int);
^~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:464:40: error: unknown type name 'u_char'
const struct pcap_pkthdr *, const u_char *);
^~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:517:25: error: unknown type name 'u_char'; did you mean '__u_char'?
PCAP_API void pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *);
^~~~~~
__u_char
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:517:69: error: unknown type name 'u_char'
PCAP_API void pcap_dump(u_char *, const struct pcap_pkthdr *, const u_char *);
^~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:547:12: error: unknown type name 'u_int'
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
^~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:547:60: error: unknown type name 'u_char'
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
^~~~~~
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:547:70: error: unknown type name 'u_int'; did you mean '__u_int'?
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
^~~~~
__u_int
/builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/usr/include/pcap/pcap.h:547:77: error: unknown type name 'u_int'; did you mean '__u_int'?
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
^~~~~
__u_int
make[6]: *** [Makefile:620: fuzz_pingip.o] Error 1
make[6]: Leaving directory '/builddir/bloop_r2/build_dir/target-mipsel_24kc_musl_R2/arping-1.0.1/src'
make[5]: *** [Makefile:377: all-recursive] Error 1
make[5]: Leaving directory '/builddir/bloop_r2/build_dir/target-mipsel_24kc_musl_R2/arping-1.0.1'
make[4]: *** [Makefile:317: all] Error 2
make[4]: Leaving directory '/builddir/bloop_r2/build_dir/target-mipsel_24kc_musl_R2/arping-1.0.1'
make[3]: *** [Makefile:37: /builddir/bloop_r2/build_dir/target-mipsel_24kc_musl_R2/arping-1.0.1/.built] Error 2
make[3]: Leaving directory '/builddir/bloop_r2/feeds/bloop_packages/arping'
time: package/feeds/bloop_packages/arping/compile#0.21#0.08#0.27
make[2]: *** [package/Makefile:113: package/feeds/bloop_packages/arping/compile] Error 2
make[2]: Leaving directory '/builddir/bloop_r2'
make[1]: *** [package/Makefile:107: /builddir/bloop_r2/staging_dir/target-mipsel_24kc_musl_R2/stamp/.package_compile] Error 2
make[1]: Leaving directory '/builddir/bloop_r2'
make: *** [/builddir/bloop_r2/include/toplevel.mk:227: world] Ошибка 2
Looks like src/fuzz_pingip.c
needs the same treatement. Could you try adding that to:
src/fuzz_pingip.c
src/fuzz_pingmac.c
src/unix.c
src/arping_test.c
src/mock_libpcap.c
They also include pcap.h
(from libpcap), which seems to be the problem.
it seems that it helped, I also added the line in src/findif_getifaddrs.c this is my dependencies: DEPENDS:=+libnet-1.2.x +libpcap +libcap Now I'll build the whole firmware with your arping and then I'll tell here if the success is reached
Thank you, it works! IT WORKS!
Thanks for confirming. I've added these defines now, so that it should just work for the next person building on openwrt or similar setup.
I am trying to make a package with arping 2.24 for openwrt, but there's only libnet-1.2.x in library, so I typed noticed it as a dependency. When compiling I got the following output: