gre: Allow IPv6 ToS bits to be propagated to tunnel packets.
authorJesse Gross <jesse@nicira.com>
Thu, 4 Mar 2010 22:02:37 +0000 (17:02 -0500)
committerJesse Gross <jesse@nicira.com>
Fri, 5 Mar 2010 21:31:27 +0000 (16:31 -0500)
The IPv6 ToS bits should have the same meaning as in IPv4, so
allow them to be copied from the inner packet to the tunnel packet
if enabled.

datapath/linux-2.6/compat-2.6/ip_gre.c

index 2f46e05..5882b3c 100644 (file)
@@ -813,6 +813,8 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
                tos = 0;
                if (skb->protocol == htons(ETH_P_IP))
                        tos = old_iph->tos;
+               else if (skb->protocol == htons(ETH_P_IPV6))
+                       tos = ipv6_get_dsfield(ipv6_hdr(skb));
        }
 
        {