All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] ip6_tunnel: fix traffic class routing for tunnels
@ 2017-06-02  5:12 Liam McBirnie
  2017-06-02  6:03 ` Peter Dawson
  2017-06-04 23:50 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Liam McBirnie @ 2017-06-02  5:12 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, netdev
  Cc: peter.a.dawson

From: Liam McBirnie <mcbirnie.l@gmail.com>
Date: Thu, 1 Jun 2017 15:36:01 +1000
Subject: [PATCH net] ip6_tunnel: fix traffic class routing for tunnels

ip6_route_output() requires that the flowlabel contains the traffic
class for policy routing.

Commit 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on
encapsulated packets") removed the code which previously added the
traffic class to the flowlabel.

The traffic class is added here because only route lookup needs the
flowlabel to contain the traffic class.

Fixes: 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets")
Signed-off-by: Liam McBirnie <liam.mcbirnie@boeing.com>
---
 net/ipv6/ip6_tunnel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 7ae6c50..9b37f97 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -1095,6 +1095,9 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield,
 
 	if (!dst) {
 route_lookup:
+		/* add dsfield to flowlabel for route lookup */
+		fl6->flowlabel = ip6_make_flowinfo(dsfield, fl6->flowlabel);
+
 		dst = ip6_route_output(net, NULL, fl6);
 
 		if (dst->error)
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] ip6_tunnel: fix traffic class routing for tunnels
  2017-06-02  5:12 [PATCH net] ip6_tunnel: fix traffic class routing for tunnels Liam McBirnie
@ 2017-06-02  6:03 ` Peter Dawson
  2017-06-04 23:50 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Dawson @ 2017-06-02  6:03 UTC (permalink / raw)
  To: Liam McBirnie
  Cc: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy, netdev, peter.a.dawson

On Fri, 2 Jun 2017 15:12:26 +1000
Liam McBirnie <mcbirnie.l@gmail.com> wrote:

> The traffic class is added here because only route lookup needs the
> flowlabel to contain the traffic class.
> 
> Fixes: 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets")
> Signed-off-by: Liam McBirnie <liam.mcbirnie@boeing.com>

Concur with this patch. Testing that I performed on Commit: 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets") did not cover the case were DSCP-based routing policy is applied to the tunneled packets. 

Acked-by: Peter Dawson <peter.a.dawson@boeing.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] ip6_tunnel: fix traffic class routing for tunnels
  2017-06-02  5:12 [PATCH net] ip6_tunnel: fix traffic class routing for tunnels Liam McBirnie
  2017-06-02  6:03 ` Peter Dawson
@ 2017-06-04 23:50 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-06-04 23:50 UTC (permalink / raw)
  To: mcbirnie.l; +Cc: kuznet, jmorris, yoshfuji, kaber, netdev, peter.a.dawson

From: Liam McBirnie <mcbirnie.l@gmail.com>
Date: Fri, 2 Jun 2017 15:12:26 +1000

> From: Liam McBirnie <mcbirnie.l@gmail.com>
> Date: Thu, 1 Jun 2017 15:36:01 +1000
> Subject: [PATCH net] ip6_tunnel: fix traffic class routing for tunnels
> 
> ip6_route_output() requires that the flowlabel contains the traffic
> class for policy routing.
> 
> Commit 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on
> encapsulated packets") removed the code which previously added the
> traffic class to the flowlabel.
> 
> The traffic class is added here because only route lookup needs the
> flowlabel to contain the traffic class.
> 
> Fixes: 0e9a709560db ("ip6_tunnel, ip6_gre: fix setting of DSCP on encapsulated packets")
> Signed-off-by: Liam McBirnie <liam.mcbirnie@boeing.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-04 23:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-02  5:12 [PATCH net] ip6_tunnel: fix traffic class routing for tunnels Liam McBirnie
2017-06-02  6:03 ` Peter Dawson
2017-06-04 23:50 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.