Not all systems have the IP_MTU_DISCOVER sockopt
This commit is contained in:
parent
d625d804c6
commit
77734c3cb7
1 changed files with 2 additions and 1 deletions
3
echoc.c
3
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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue