n42n / n3n

Peer to Peer VPN
https://n3n.dev
86 stars 9 forks source link

3.3.2 fails to build on OpenBSD 7.3 #19

Closed vaygr closed 7 months ago

vaygr commented 7 months ago

Same as in https://github.com/ntop/n2n/issues/1170:

CC is: cc -DVERSION='"3.3.2"' -DBUILDDATE='"Sat Mar 30 13:36:42 UTC 2024"' -g -O2   -Wall   -In3n-3.3.2/include -DHAVE_BRIDGING_SUPPORT -In3n-3.3.2/libs  -c -o $@ $<
Build for version: 3.3.2
for dir in tools apps; do gmake -C $dir; done
gmake[1]: Entering directory 'n3n-3.3.2/tools'
CC is: cc -DVERSION='"3.3.2"' -DBUILDDATE='"Sat Mar 30 13:36:42 UTC 2024"' -g -O2   -Wall   -In3n-3.3.2/include -DHAVE_BRIDGING_SUPPORT -In3n-3.3.2/libs  -Ln3n-3.3.2/src -Ln3n-3.3.2/libs/connslot $^ -ln3n -lconnslot  -o $@
  CC      n3n-benchmark
edge_utils.c:2605 (src/edge_utils.c:2605)(edge_utils.o:(process_udp) in archive n3n-3.3.2/src/libn3n.a): warning: sprintf() is often misused, please use snprintf()
network_traffic_filter.c:85 (src/network_traffic_filter.c:85)(network_traffic_filter.o:(get_filter_packet_info_log_string) in archive n3n-3.3.2/src/libn3n.a): warning: strcpy() is almost always misused, please use strlcpy()
ld: error: undefined symbol: tuntap_read
>>> referenced by edge_utils.c:2208 (src/edge_utils.c:2208)
>>>               edge_utils.o:(edge_read_from_tap) in archive n3n-3.3.2/src/libn3n.a

ld: error: undefined symbol: tuntap_close
>>> referenced by edge_utils.c:2221 (src/edge_utils.c:2221)
>>>               edge_utils.o:(edge_read_from_tap) in archive n3n-3.3.2/src/libn3n.a
>>> referenced by edge_utils.c:3424 (src/edge_utils.c:3424)
>>>               edge_utils.o:(quick_edge_init) in archive n3n-3.3.2/src/libn3n.a

ld: error: undefined symbol: tuntap_open
>>> referenced by edge_utils.c:2222 (src/edge_utils.c:2222)
>>>               edge_utils.o:(edge_read_from_tap) in archive n3n-3.3.2/src/libn3n.a
>>> referenced by edge_utils.c:3408 (src/edge_utils.c:3408)
>>>               edge_utils.o:(quick_edge_init) in archive n3n-3.3.2/src/libn3n.a

ld: error: undefined symbol: tuntap_write
>>> referenced by edge_utils.c:1875 (src/edge_utils.c:1875)
>>>               edge_utils.o:(process_udp) in archive n3n-3.3.2/src/libn3n.a

ld: error: undefined symbol: tuntap_get_address
>>> referenced by edge_utils.c:3120 (src/edge_utils.c:3120)
>>>               edge_utils.o:(run_edge_loop) in archive n3n-3.3.2/src/libn3n.a
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [Makefile:28: n3n-benchmark] Error 1
gmake[1]: Leaving directory 'n3n-3.3.2/tools'
gmake[1]: Entering directory 'n3n-3.3.2/apps'
cc -DVERSION='"3.3.2"' -DBUILDDATE='"Sat Mar 30 13:36:42 UTC 2024"' -g -O2   -Wall   -In3n-3.3.2/include -DHAVE_BRIDGING_SUPPORT -In3n-3.3.2/libs  -Ln3n-3.3.2/src -Ln3n-3.3.2/libs/connslot  n3n-edge.c ../src/libn3n.a  -ln3n -lconnslot  -o n3n-edge
edge_utils.c:2605 (src/edge_utils.c:2605)(edge_utils.o:(process_udp) in archive ../src/libn3n.a): warning: sprintf() is often misused, please use snprintf()
network_traffic_filter.c:85 (src/network_traffic_filter.c:85)(network_traffic_filter.o:(get_filter_packet_info_log_string) in archive ../src/libn3n.a): warning: strcpy() is almost always misused, please use strlcpy()
ld: error: undefined symbol: tuntap_open
>>> referenced by n3n-edge.c:949
>>>               /tmp/n3n-edge-5e943c.o:(main)
>>> referenced by edge_utils.c:2222 (src/edge_utils.c:2222)
>>>               edge_utils.o:(edge_read_from_tap) in archive ../src/libn3n.a
>>> referenced by edge_utils.c:3408 (src/edge_utils.c:3408)
>>>               edge_utils.o:(quick_edge_init) in archive ../src/libn3n.a

ld: error: undefined symbol: tuntap_close
>>> referenced by n3n-edge.c:1072
>>>               /tmp/n3n-edge-5e943c.o:(main)
>>> referenced by edge_utils.c:2221 (src/edge_utils.c:2221)
>>>               edge_utils.o:(edge_read_from_tap) in archive ../src/libn3n.a
>>> referenced by edge_utils.c:3424 (src/edge_utils.c:3424)
>>>               edge_utils.o:(quick_edge_init) in archive ../src/libn3n.a

ld: error: undefined symbol: tuntap_read
>>> referenced by edge_utils.c:2208 (src/edge_utils.c:2208)
>>>               edge_utils.o:(edge_read_from_tap) in archive ../src/libn3n.a

ld: error: undefined symbol: tuntap_write
>>> referenced by edge_utils.c:1875 (src/edge_utils.c:1875)
>>>               edge_utils.o:(process_udp) in archive ../src/libn3n.a

ld: error: undefined symbol: tuntap_get_address
>>> referenced by edge_utils.c:3120 (src/edge_utils.c:3120)
>>>               edge_utils.o:(run_edge_loop) in archive ../src/libn3n.a
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [<builtin>: n3n-edge] Error 1
gmake[1]: Leaving directory 'n3n-3.3.2/apps'
gmake: *** [Makefile:248: subdirs] Error 2
hamishcoleman commented 7 months ago

Thanks for testing!

The CI is setup just for freebsd 13.2 right now, but it should be able to run an OpenBSD test (see https://github.com/n42n/n3n/actions/runs/8481738726/job/23239672681 for a recent freebsd example)

I'll try and run some tests in the next couple of days, but it looks like it could be a simple ifdef addition

hamishcoleman commented 7 months ago

Fixed in 7a0fac2b89f6, which has been merged into main