From 356e7b3a69dcfdad8f8d09ce921c11e0566cb99c Mon Sep 17 00:00:00 2001 From: David Schweikert Date: Tue, 10 Jan 2017 15:52:58 +0100 Subject: [PATCH] fix compatibility issue with MacOS in release 3.14 (fixes #109) --- src/fping.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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':