diff --git a/doc/Changelog b/doc/Changelog index a0e5712ff..315502d8d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +11 December 2009: Wouter + - on IPv4 UDP turn off DF flag. + 10 December 2009: Wouter - requirements.txt updated with design choice explanations. - Reading fixes: fix to set unlame when child confirms parent glue, diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index 5ec2462b0..54be19d74 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -251,6 +251,25 @@ create_udp_sock(int family, int socktype, struct sockaddr* addr, return -1; } # endif /* IPv6 MTU */ + } else if(family == AF_INET) { +# if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) + int action = IP_PMTUDISC_DONT; + if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, + &action, (socklen_t)sizeof(action)) < 0) { + log_err("setsockopt(..., IP_MTU_DISCOVER, " + "IP_PMTUDISC_DONT...) failed: %s", + strerror(errno)); + return -1; + } +# elif defined(IP_DONTFRAG) + int off = 0; + if (setsockopt(s, IPPROTO_IP, IP_DONTFRAG, + &off, (socklen_t)sizeof(off)) < 0) { + log_err("setsockopt(..., IP_DONTFRAG, ...) failed: %s", + strerror(errno)); + return -1; + } +# endif /* IPv4 MTU */ } if(bind(s, (struct sockaddr*)addr, addrlen) != 0) { *noproto = 0;