From: James Clarke Date: Sat, 7 Oct 2017 17:53:21 +0000 (+0100) Subject: networking: Fall back on IPPROTO_RAW when SOL_RAW is not defined X-Git-Tag: 1_28_0~28 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4d0971b7fbb9069c104e3746bb22d2155ec275ee;p=oweals%2Fbusybox.git networking: Fall back on IPPROTO_RAW when SOL_RAW is not defined Signed-off-by: James Clarke Signed-off-by: Denys Vlasenko --- diff --git a/networking/ping.c b/networking/ping.c index 774f8f3e0..d1d59d545 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -135,6 +135,14 @@ # define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */ #endif +/* Some operating systems, like GNU/Hurd, don't define SOL_RAW, but do have + * IPPROTO_RAW. Since the IPPROTO definitions are also valid to use for + * setsockopt (and take the same value as their corresponding SOL definitions, + * if they exist), we can just fall back on IPPROTO_RAW. */ +#ifndef SOL_RAW +# define SOL_RAW IPPROTO_RAW +#endif + #if ENABLE_PING6 # include /* I see RENUMBERED constants in bits/in.h - !!? diff --git a/networking/traceroute.c b/networking/traceroute.c index 8b6247482..df7122047 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c @@ -323,6 +323,14 @@ # define IPPROTO_IP 0 #endif +/* Some operating systems, like GNU/Hurd, don't define SOL_RAW, but do have + * IPPROTO_RAW. Since the IPPROTO definitions are also valid to use for + * setsockopt (and take the same value as their corresponding SOL definitions, + * if they exist), we can just fall back on IPPROTO_RAW. */ +#ifndef SOL_RAW +# define SOL_RAW IPPROTO_RAW +#endif + #define OPT_STRING \ "FIlnrdvxt:i:m:p:q:s:w:z:f:" \