From 77734c3cb758efe19df3c7d53f574b827164c742 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Tue, 29 Sep 2015 19:18:07 +0200 Subject: [PATCH] Not all systems have the IP_MTU_DISCOVER sockopt --- echoc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/echoc.c b/echoc.c index 9ea5790..5319a41 100644 --- a/echoc.c +++ b/echoc.c @@ -167,6 +167,7 @@ main(int argc, char *argv[]) if (buf == NULL) err(2, "malloc receive buffer"); +#ifdef IP_MTU_DISCOVER /* set the DF flag ? */ if (nofragment) ch = IP_PMTUDISC_DO; @@ -174,7 +175,7 @@ main(int argc, char *argv[]) ch = IP_PMTUDISC_DONT; if (setsockopt(sock, IPPROTO_IP, IP_MTU_DISCOVER, &ch, sizeof(ch)) < 0) err(2, "setsockopt IP_MTU_DISCOVER"); - +#endif while (1) { /* poll() loop to handle interruptions by SIGALRM */ while (1) {