Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290086
b: refs/heads/master
c: 7a3198a
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Benc authored and David S. Miller committed Feb 13, 2012
1 parent 034ae28 commit 3ca981c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 72e60278d7e4a600fd6e067b42a5822e72946d6e
refs/heads/master: 7a3198a89722ad9521d22b05938d357eac7460fa
5 changes: 5 additions & 0 deletions trunk/include/linux/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv6/datagram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 3ca981c

Please sign in to comment.