gre: fix ToS/DiffServ inherit bug
Subsystems (3)
PATCH 1/1 gre: fix ToS/DiffServ inherit bug
Fixes two bugs:
- ToS/DiffServ inheritance was unintentionally activated when using impair fixed ToS values
- ECN bit was lost during ToS/DiffServ inheritance
net/ipv4/ip_gre.c +2 -2
@@ -677,10 +677,10 @@ } tos = tiph->tos; -if (tos&1 ) { +if (tos ==1 ) { + tos =0 ;if (skb->protocol ==htons (ETH_P_IP )) tos = old_iph->tos; - tos &= ~1 ; } {
David Miller
maintainerFrom: Andreas Jaggi <[email protected]>
Date: Tue, 14 Jul 2009 17:36:48 +0200
Quoted 5 lines
Fixes two bugs:
- ToS/DiffServ inheritance was unintentionally activated when using impair fixed ToS values
- ECN bit was lost during ToS/DiffServ inheritanceSigned-off-by Andreas Jaggi <[email protected]>
...
net/ipv4/ip_gre.c line 684
Quoted 8 lines
net/ipv4/ip_gre.c +2
-2tos = tiph->tos; -if (tos&1 ) { +if (tos ==1 ) { + tos =0 ;if (skb->protocol ==htons (ETH_P_IP )) tos = old_iph->tos; - tos &= ~1 ; }
Note that this only works out because one wouldn't specify ECN bits in the TOS to use for the tunnel.
But it demonstrates the outright danger of trying to use "undefined" flag bits in protocol header fields to pass private control flags into the driver from user interfaces.
David Miller
maintainerFrom: David Miller <[email protected]>
Date: Tue, 14 Jul 2009 09:34:33 -0700 (PDT)
Quoted 8 lines
From: Andreas Jaggi <[email protected]>
Date: Tue, 14 Jul 2009 17:36:48 +0200Quoted 5 lines
Fixes two bugs:
- ToS/DiffServ inheritance was unintentionally activated when using impair fixed ToS values
- ECN bit was lost during ToS/DiffServ inheritanceSigned-off-by Andreas Jaggi <[email protected]>
In case it wasn't clear, I've applied this patch.
Hello!
Quoted 6 lines · David Miller
Note that this only works out because one wouldn't specify ECN bits in the TOS to use for the tunnel.
But it demonstrates the outright danger of trying to use "undefined" flag bits in protocol header fields to pass private control flags into the driver from user interfaces.
Yes. My fault.
Well, in the form after the patch it will survive at least until the next change of semantics of tos. :-)
Alexey