From: David Schweikert Date: Tue, 10 Jan 2017 14:52:58 +0000 (+0100) Subject: fix compatibility issue with MacOS in release 3.14 (fixes #109) X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=356e7b3a69dcfdad8f8d09ce921c11e0566cb99c;p=fping.git fix compatibility issue with MacOS in release 3.14 (fixes #109) --- diff --git a/src/fping.c b/src/fping.c index fd424eb..b02493c 100644 --- a/src/fping.c +++ b/src/fping.c @@ -387,12 +387,17 @@ int main( int argc, char **argv ) switch( c ) { case 'M': +#ifdef IP_MTU_DISCOVER { - int val = IP_PMTUDISC_DO; - if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, &val, sizeof(val))) { - perror("setsockopt IP_MTU_DISCOVER"); - } + int val = IP_PMTUDISC_DO; + if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, &val, sizeof(val))) { + perror("setsockopt IP_MTU_DISCOVER"); + } } +#else + fprintf(stderr, "-M option not supported on this platform\n"); + exit(1); +#endif break; case 't':