From: Stephen Hemminger Date: Fri, 9 Jul 2010 04:35:58 +0000 (-0700) Subject: gre: propagate ipv6 transport class X-Git-Tag: MMI-PSA29.97-13-9~23092^2~312 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dd4ba83dc1becbb3bb383851381c10c372e47247;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git gre: propagate ipv6 transport class This patch makes IPV6 over IPv4 GRE tunnel propagate the transport class field from the underlying IPV6 header to the IPV4 Type Of Service field. Without the patch, all IPV6 packets in tunnel look the same to QoS. This assumes that IPV6 transport class is exactly the same as IPv4 TOS. Not sure if that is always the case? Maybe need to mask off some bits. The mask and shift to get tclass is copied from ipv6/datagram.c Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 749e54889e82..945b20a5ad50 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -731,6 +731,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((struct ipv6hdr *)old_iph); } {