ipv6: helper function to get tclass
Implement helper inline function to get traffic class from IPv6 header. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
72e60278d7
commit
7a3198a897
@ -485,7 +485,7 @@ int datagram_recv_ctl(struct sock *sk, struct msghdr *msg, struct sk_buff *skb)
|
||||
}
|
||||
|
||||
if (np->rxopt.bits.rxtclass) {
|
||||
int tclass = (ntohl(*(__be32 *)ipv6_hdr(skb)) >> 20) & 0xff;
|
||||
int tclass = ipv6_tclass(ipv6_hdr(skb));
|
||||
put_cmsg(msg, SOL_IPV6, IPV6_TCLASS, sizeof(tclass), &tclass);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user