traviscross / mtr

Official repository for mtr, a network diagnostic tool
http://www.bitwizard.nl/mtr/
GNU General Public License v2.0
2.64k stars 337 forks source link

error: use of undeclared identifier 'SO_BINDTODEVICE' #442

Closed vollkommenheit closed 2 years ago

vollkommenheit commented 2 years ago

Trying to compile mtr post 2022-7-20, I get:

CC packet/construct_unix.o packet/construct_unix.c:297:9: warning: unused variable 'udp_socket' [-Wunused-variable] int udp_socket = net_state->platform.udp6_send_socket; ^ packet/construct_unix.c:403:24: error: use of undeclared identifier 'SO_BINDTODEVICE' SO_BINDTODEVICE, param->local_device, strlen(param->local_device))) { ^ packet/construct_unix.c:626:24: error: use of undeclared identifier 'SO_BINDTODEVICE' SO_BINDTODEVICE, param->local_device, strlen(param->local_device))) { ^ packet/construct_unix.c:801:36: error: use of undeclared identifier 'SO_BINDTODEVICE' SOL_SOCKET, SO_BINDTODEVICE, param->local_device, ^ 1 warning and 3 errors generated. make: *** [packet/construct_unix.o] Error 1

This is likely affecting BSD-like systems such as macOS/Darwin, per https://sourceforge.net/p/net-snmp/patches/1296/ https://github.com/FRRouting/frr/issues/5978

rewolff commented 2 years ago

It should compile again, but the big question is if the -I option works for you.

vollkommenheit commented 2 years ago

It should compile again, but the big question is if the -I option works for you.

Yep, it compiles fine now. And -l seems to be working fine too. Thanks!

mtr -l 1.1.1.1 h 1 192.168.1.1 h 1 192.168.1.1 p 1 6799 33001 x 2 33002