IPv6 frames MUST support 1280 bytes at least, but IPv4 frames
MAY be much smaller. This is theoretical, but as a result, a
tunnel NEEDS to support fragmentation.
// Setup fragmentation, QoS and TTL options
u_int yes = 1;
u_int no = 0;
// Setup fragmentation, QoS and TTL options
u_int yes = 1;
u_int no = 0;
+#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");
}
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
#else
#warning "Target system lacks support for controlling packet fragmentation"
#endif