summaryrefslogtreecommitdiff
blob: fb24734d0f2bd6fe6422da11bdd771d1ac8a0828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff -ru unbound-1.5.1-orig/services/listen_dnsport.c unbound-1.5.1/services/listen_dnsport.c
--- unbound-1.5.1-orig/services/listen_dnsport.c	2014-09-16 15:49:21.000000000 +0200
+++ unbound-1.5.1/services/listen_dnsport.c	2014-12-21 08:15:39.126734451 +0100
@@ -361,6 +361,7 @@
 		}
 # endif /* IPv6 MTU */
 	} else if(family == AF_INET) {
+		int omit = 0;
 #  if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
 /* linux 3.15 has IP_PMTUDISC_OMIT, Hannes Frederic Sowa made it so that
  * PMTU information is not accepted, but fragmentation is allowed
@@ -373,8 +374,11 @@
 #    else
 		int action = IP_PMTUDISC_DONT;
 #    endif
+blahblah:
 		if (setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, 
 			&action, (socklen_t)sizeof(action)) < 0) {
+			omit++;
+			if (errno != EINVAL) {
 			log_err("setsockopt(..., IP_MTU_DISCOVER, "
 #    if defined(IP_PMTUDISC_OMIT)
 				"IP_PMTUDISC_OMIT"
@@ -391,6 +395,11 @@
 			*noproto = 0;
 			*inuse = 0;
 			return -1;
+		}}
+		if (omit == 1) {
+		omit++;
+		action = IP_PMTUDISC_DONT;
+		goto blahblah;
 		}
 #  elif defined(IP_DONTFRAG)
 		int off = 0;