<< | Thread Index | >> ]    [ << | Date Index | >> ]

Subject: [RFC] "CIPE ethernet devices should have an MTU of 1500"
From: Lennert Buytenhek <buytenh,AT,gnu,DOT,org>
Date: Fri, 2 Nov 2001 00:43:44 +0100

Hi,

If you want to enslave a CIPE ethernet device to an ordinary bridge port
group, the CIPE device will have to 'emulate' an MTU of 1500, since a lot of
things downright depend on this.  IMHO, the fact that this causes
fragmentation at the UDP level is secondary.  For a vanilla IP tunnel I'll
buy the argument that not fragmenting the encrypted-and-encapsulated
packet is important, but in the case of ethernet, I think the MTU guarantee
is sacred.

Opinions?

I'm using the attached (shoddy) patch for this.  If people agree with me on
this I'll make a clean patch, conditional on the protocol version et al.

cheers,
Lennert

--- cipe-1.5.2/cipe/output.c.orig       Thu Nov  1 22:39:14 2001
+++ cipe-1.5.2/cipe/output.c    Thu Nov  1 22:40:53 2001
@@ -90,7 +90,7 @@
        struct NET_DEVICE *tdev;                        /* Device to other 
host */
        struct iphdr  *old_iph;
        u8      tos = 0;
-       u16     df = 0;
+//     u16     df = 0;
        u8      ttl;

        struct iphdr  *iph;                     /* Our new IP header */
@@ -133,7 +133,7 @@
                goto tx_error_out;
            }
            tos = old_iph->tos;
-           df = old_iph->frag_off&__constant_htons(IP_DF);
+//         df = old_iph->frag_off&__constant_htons(IP_DF);
            ttl = tunnel->cttl ? tunnel->cttl : old_iph->ttl;
        } else {
            ttl = tunnel->cttl ? tunnel->cttl : 64; /* XX */
@@ -177,9 +177,13 @@
                goto tx_error;
        }

+#if 0
         mtu = rt->u.dst.pmtu - (cipehdrlen+cipefootlen);
         if (tunnel->sockshost)
             mtu -= sizeof(struct sockshdr);
+#endif
+       mtu = 1500;
+

         dprintk(DEB_OUT, (KERN_DEBUG "pmtu=%d dmtu=%d size=%d\n",
                           mtu, tdev->mtu, skb->len));
@@ -278,7 +282,8 @@
        iph->tos        =       tos;
        iph->tot_len    =       htons(skb->len);
        ip_ident(iph, &rt->u.dst);
-        iph->frag_off   =      df;
+//        iph->frag_off   =    df;
+        iph->frag_off   =      0;
         iph->ttl        =      ttl;
        iph->protocol   =       IPPROTO_UDP;
        iph->saddr      =       rt->rt_src;
--- cipe-1.5.2/cipe/device.c.orig       Thu Nov  1 23:20:44 2001
+++ cipe-1.5.2/cipe/device.c    Thu Nov  1 23:20:54 2001
@@ -473,10 +473,7 @@
     dev->hard_header_len        = 0; /* we copy anyway to expand */
     dev->tx_queue_len          = 100; /* matches ethernet */
 #endif
-    dev->mtu                   = ETH_DATA_LEN
-                                     -sizeof(struct sockshdr)
-                                     -cipehdrlen
-                                     -cipefootlen;
+    dev->mtu                   = 1500;

 #ifdef LINUX_21





<< | Thread Index | >> ]    [ << | Date Index | >> ]