* Re: DSCP of ICMPv6 Echo Reply not copied from Echo Request
2014-01-08 14:34 DSCP of ICMPv6 Echo Reply not copied from Echo Request Simon Schneider
@ 2014-01-10 4:40 ` Hannes Frederic Sowa
2014-01-11 10:55 ` [PATCH net-next] ipv6: copy traffic class from ping request to reply Hannes Frederic Sowa
1 sibling, 0 replies; 4+ messages in thread
From: Hannes Frederic Sowa @ 2014-01-10 4:40 UTC (permalink / raw)
To: Simon Schneider; +Cc: netdev
Hello!
On Wed, Jan 08, 2014 at 03:34:42PM +0100, Simon Schneider wrote:
> with kernel version 2.6.33.32, I noticed for ping6 that the DSCP value of an Echo Request is not used for the corresponding Echo Reply.
>
> With ICMPv4, this is the case and I think it makes sense.
>
> This is not mandated by ICMP RFCs, but there are good reasons to use the same DSCP in both directions.
Yes, IMHO we should do that, especially because DSCP is sometimes used for
policy routing.
> Is there a specific reason for this difference between v4 and v6?
>
> Or was it even fixed in some newer kernel version?
Quick test showed no, I'll follow-up on this soon.
Greetings,
Hannes
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next] ipv6: copy traffic class from ping request to reply
2014-01-08 14:34 DSCP of ICMPv6 Echo Reply not copied from Echo Request Simon Schneider
2014-01-10 4:40 ` Hannes Frederic Sowa
@ 2014-01-11 10:55 ` Hannes Frederic Sowa
2014-01-14 23:09 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Hannes Frederic Sowa @ 2014-01-11 10:55 UTC (permalink / raw)
To: Simon Schneider; +Cc: netdev
Suggested-by: Simon Schneider <simon-schneider@gmx.net>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
net/ipv6/icmp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 9a809a4..8003b49 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -67,6 +67,7 @@
#include <net/icmp.h>
#include <net/xfrm.h>
#include <net/inet_common.h>
+#include <net/dsfield.h>
#include <asm/uaccess.h>
@@ -553,6 +554,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
struct dst_entry *dst;
int err = 0;
int hlimit;
+ u8 tclass;
saddr = &ipv6_hdr(skb)->daddr;
@@ -603,8 +605,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
msg.offset = 0;
msg.type = ICMPV6_ECHO_REPLY;
+ tclass = ipv6_get_dsfield(ipv6_hdr(skb));
err = ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr),
- sizeof(struct icmp6hdr), hlimit, np->tclass, NULL, &fl6,
+ sizeof(struct icmp6hdr), hlimit, tclass, NULL, &fl6,
(struct rt6_info *)dst, MSG_DONTWAIT,
np->dontfrag);
--
1.8.4.2
^ permalink raw reply related [flat|nested] 4+ messages in thread