]> git.gsnw.org Git - fping.git/commitdiff
fix compatibility issue with MacOS in release 3.14 (fixes #109)
authorDavid Schweikert <david@schweikert.ch>
Tue, 10 Jan 2017 14:52:58 +0000 (15:52 +0100)
committerDavid Schweikert <david@schweikert.ch>
Tue, 10 Jan 2017 14:52:58 +0000 (15:52 +0100)
src/fping.c

index fd424ebc5f138f2f7fe788421f52398be6ed1d72..b02493c47dae2b1471f9888a4abee9e4133a96e3 100644 (file)
@@ -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':