Skip to contentSkip to conversation

sit tunnels: propagate IPv6 transport class to IPv4 Type of Service

PATCH Applied Lionel Elie Mamane 2 participants 2 messages Aug 14, 2011 – Aug 16, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sit tunnels: propagate IPv6 transport class to IPv4 Type of Service

sit tunnels (IPv6 tunnel over IPv4) do not implement the "tos inherit" case to copy the IPv6 transport class byte from the inner packet to the IPv4 type of service byte in the outer packet. By contrast, ipip tunnels and GRE tunnels do.

This patch, adapted from the similar code in net/ipv4/ipip.c and net/ipv4/ip_gre.c, implements that.

This patch applies to 3.0.1, and has been tested on that version.

---
 net/ipv6/sit.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
net/ipv6/sit.c +4 -0
index 1cca576..bbe2468 100644
@@ -672,6 +672,10 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
 	if (skb->protocol != htons(ETH_P_IPV6))
 		goto tx_error;
 
+
+	if (tos == 1)
+		tos = ipv6_get_dsfield(iph6);
+
 	/* ISATAP (RFC4214) - must come before 6to4 */
 	if (dev->priv_flags & IFF_ISATAP) {
 		struct neighbour *neigh = NULL;
Signature · 1 line
Lionel Mamane
maintainer Applied
#1 lore raw

From: Lionel Elie Mamane <[email protected]>
Date: Sun, 14 Aug 2011 02:04:38 +0200

Quoted 5 lines

sit tunnels (IPv6 tunnel over IPv4) do not implement the "tos inherit" case to copy the IPv6 transport class byte from the inner packet to the IPv4 type of service byte in the outer packet. By contrast, ipip tunnels and GRE tunnels do.

Quoted 7 lines

This patch, adapted from the similar code in net/ipv4/ipip.c and net/ipv4/ip_gre.c, implements that.

This patch applies to 3.0.1, and has been tested on that version.

Applied, thanks.