From 3ca981c2707b34de1dece0f62717d408687dc6d7 Mon Sep 17 00:00:00 2001 From: Jiri Benc Date: Thu, 9 Feb 2012 09:34:41 +0000 Subject: [PATCH] --- yaml --- r: 290086 b: refs/heads/master c: 7a3198a89722ad9521d22b05938d357eac7460fa h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/ipv6.h | 5 +++++ trunk/net/ipv6/datagram.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index bf1d54c0f3e0..6b034dfa6978 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 72e60278d7e4a600fd6e067b42a5822e72946d6e +refs/heads/master: 7a3198a89722ad9521d22b05938d357eac7460fa diff --git a/trunk/include/linux/ipv6.h b/trunk/include/linux/ipv6.h index 743a16a41040..4847a64d3c0a 100644 --- a/trunk/include/linux/ipv6.h +++ b/trunk/include/linux/ipv6.h @@ -233,6 +233,11 @@ static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb) return (struct ipv6hdr *)skb_transport_header(skb); } +static inline __u8 ipv6_tclass(const struct ipv6hdr *iph) +{ + return (ntohl(*(__be32 *)iph) >> 20) & 0xff; +} + /* This structure contains results of exthdrs parsing as offsets from skb->nh. diff --git a/trunk/net/ipv6/datagram.c b/trunk/net/ipv6/datagram.c index 251e7cd75e89..76832c8dc89d 100644 --- a/trunk/net/ipv6/datagram.c +++ b/trunk/net/ipv6/datagram.c @@ -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); }