From: Darafei Praliaskouski Date: Thu, 7 May 2026 21:50:58 +0000 (+0400) Subject: fix(packet): retain bind-to-device capability X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=refs%2Fpull%2F604%2Fhead;p=thirdparty%2Fmtr.git fix(packet): retain bind-to-device capability --- diff --git a/packet/construct_unix.c b/packet/construct_unix.c index f86fd52..6362c1a 100644 --- a/packet/construct_unix.c +++ b/packet/construct_unix.c @@ -882,9 +882,7 @@ int construct_ip6_packet( #ifdef SO_BINDTODEVICE if (param->local_device) { - if (setsockopt(send_socket, - SOL_SOCKET, SO_BINDTODEVICE, param->local_device, - strlen(param->local_device))) { + if (set_bind_to_device(send_socket, param->local_device)) { return -1; } } diff --git a/packet/packet.c b/packet/packet.c index 5f3a39b..9721b5b 100644 --- a/packet/packet.c +++ b/packet/packet.c @@ -28,6 +28,9 @@ #include #include #include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif #ifdef HAVE_LIBCAP #include