Updated the resetting of the Don't Fragment bit
[6bed4] / 6bed4peer.c
index ab7ec4e..66fee24 100644 (file)
@@ -1852,10 +1852,15 @@ int main (int argc, char *argv []) {
        // Setup fragmentation, QoS and TTL options
        u_int yes = 1;
        u_int no = 0;
-#ifdef IP_DONTFRAG
+#if defined(IP_DONTFRAG)
        if (setsockopt (v4sox, IPPROTO_IP, IP_DONTFRAG, no, sizeof (no)) == -1) {
                syslog (LOG_ERR, "Failed to permit fragmentation -- not all peers may be accessible with MTU 1280");
        }
+#elif defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
+       int pmtuflag = IP_PMTUDISC_DONT;
+       if (setsockopt (v4sox, IP_MTU_DISCOVER, IP_MTU_DISCOVER, &pmtuflag, sizeof (pmtuflag)) == -1) {
+               syslog (LOG_ERR, "Failed to permit fragmentation -- not all peers may be accessible with MTU 1280");
+       }
 #else
 #warning "Target system lacks support for controlling packet fragmentation"
 #endif