Skip to content

Commit 825edac

Browse files
strssndktndavem330
authored andcommitted
ipv6: copy traffic class from ping request to reply
Suggested-by: Simon Schneider <[email protected]> Signed-off-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 72c1d3b commit 825edac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/ipv6/icmp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#include <net/icmp.h>
6868
#include <net/xfrm.h>
6969
#include <net/inet_common.h>
70+
#include <net/dsfield.h>
7071

7172
#include <asm/uaccess.h>
7273

@@ -553,6 +554,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
553554
struct dst_entry *dst;
554555
int err = 0;
555556
int hlimit;
557+
u8 tclass;
556558

557559
saddr = &ipv6_hdr(skb)->daddr;
558560

@@ -603,8 +605,9 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
603605
msg.offset = 0;
604606
msg.type = ICMPV6_ECHO_REPLY;
605607

608+
tclass = ipv6_get_dsfield(ipv6_hdr(skb));
606609
err = ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr),
607-
sizeof(struct icmp6hdr), hlimit, np->tclass, NULL, &fl6,
610+
sizeof(struct icmp6hdr), hlimit, tclass, NULL, &fl6,
608611
(struct rt6_info *)dst, MSG_DONTWAIT,
609612
np->dontfrag);
610613

0 commit comments

Comments
 (0)