* [PATCH] gre: fix ToS/DiffServ inherit bug
@ 2009-07-14 15:36 Andreas Jaggi
2009-07-14 16:34 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Jaggi @ 2009-07-14 15:36 UTC (permalink / raw)
To: Wojtek Sawasciuk; +Cc: netdev, kuznet, kaber, davem
Fixes two bugs:
- ToS/DiffServ inheritance was unintentionally activated when using impair fixed ToS values
- ECN bit was lost during ToS/DiffServ inheritance
Signed-off-by: Andreas Jaggi <aj@open.ch>
--- vanilla-linux-2.6.29.4/net/ipv4/ip_gre.c 2009-05-19 01:52:34.000000000 +0200
+++ gre-dev-2/net/ipv4/ip_gre.c 2009-07-14 17:14:34.000000000 +0200
@@ -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;
}
{
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] gre: fix ToS/DiffServ inherit bug
2009-07-14 15:36 [PATCH] gre: fix ToS/DiffServ inherit bug Andreas Jaggi
@ 2009-07-14 16:34 ` David Miller
2009-07-14 16:43 ` David Miller
2009-07-14 17:28 ` Alexey Kuznetsov
0 siblings, 2 replies; 4+ messages in thread
From: David Miller @ 2009-07-14 16:34 UTC (permalink / raw)
To: aj; +Cc: voyo, netdev, kuznet, kaber
From: Andreas Jaggi <aj@open.ch>
Date: Tue, 14 Jul 2009 17:36:48 +0200
> Fixes two bugs:
> - ToS/DiffServ inheritance was unintentionally activated when using impair fixed ToS values
> - ECN bit was lost during ToS/DiffServ inheritance
>
> Signed-off-by: Andreas Jaggi <aj@open.ch>
...
> tos = 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.
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] gre: fix ToS/DiffServ inherit bug
2009-07-14 16:34 ` David Miller
@ 2009-07-14 16:43 ` David Miller
2009-07-14 17:28 ` Alexey Kuznetsov
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2009-07-14 16:43 UTC (permalink / raw)
To: aj; +Cc: voyo, netdev, kuznet, kaber
From: David Miller <davem@davemloft.net>
Date: Tue, 14 Jul 2009 09:34:33 -0700 (PDT)
> From: Andreas Jaggi <aj@open.ch>
> Date: Tue, 14 Jul 2009 17:36:48 +0200
>
>> Fixes two bugs:
>> - ToS/DiffServ inheritance was unintentionally activated when using impair fixed ToS values
>> - ECN bit was lost during ToS/DiffServ inheritance
>>
>> Signed-off-by: Andreas Jaggi <aj@open.ch>
In case it wasn't clear, I've applied this patch.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gre: fix ToS/DiffServ inherit bug
2009-07-14 16:34 ` David Miller
2009-07-14 16:43 ` David Miller
@ 2009-07-14 17:28 ` Alexey Kuznetsov
1 sibling, 0 replies; 4+ messages in thread
From: Alexey Kuznetsov @ 2009-07-14 17:28 UTC (permalink / raw)
To: David Miller; +Cc: aj, voyo, netdev, kaber
Hello!
On Tue, Jul 14, 2009 at 09:34:33AM -0700, David Miller wrote:
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-14 17:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-14 15:36 [PATCH] gre: fix ToS/DiffServ inherit bug Andreas Jaggi
2009-07-14 16:34 ` David Miller
2009-07-14 16:43 ` David Miller
2009-07-14 17:28 ` Alexey Kuznetsov
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.