[ovs-dev] [PATCH 2/3] tunneling: Add fine-grained control of Don't Fragment bit.

Andrew Evans aevans at nicira.com
Fri Apr 29 18:35:40 UTC 2011


On Thu, 2011-04-28 at 17:05 -0700, Jesse Gross wrote:
> On Wed, Apr 27, 2011 at 2:59 PM, Andrew Evans <aevans at nicira.com> wrote:
> > @@ -756,7 +755,8 @@ static bool check_mtu(struct sk_buff *skb,
> >        if (skb->protocol == htons(ETH_P_IP)) {
> >                struct iphdr *iph = ip_hdr(skb);
> >
> > -               frag_off |= iph->frag_off & htons(IP_DF);
> > +               if (df_inherit)
> > +                       frag_off = iph->frag_off & htons(IP_DF);
> 
> I think you need to something similar for IPv6 as well.

Like this?

diff --git a/datapath/tunnel.c b/datapath/tunnel.c
index 899d1cd..70a4cd7 100644
--- a/datapath/tunnel.c
+++ b/datapath/tunnel.c
@@ -769,8 +769,10 @@ static bool check_mtu(struct sk_buff *skb,
        }
 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
        else if (skb->protocol == htons(ETH_P_IPV6)) {
-               /* IPv6 requires PMTUD if the packet is above the minimum MTU. */
-               if (packet_length > IPV6_MIN_MTU)
+               /* IPv6 requires end hosts to do fragmentation
+                * if the packet is above the minimum MTU.
+                */
+               if (df_inherit && packet_length > IPV6_MIN_MTU)
                        frag_off = htons(IP_DF);
 
                if (pmtud) {





More information about the dev mailing list