aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ipv6.h
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>2013-01-13 00:01:39 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-13 20:17:13 -0500
commit3e4e4c1f2da66b29ee9379ca29f8dd620c2b5a1f (patch)
treeee6dfd76e5949b84b8c25136a4563925d0033cfa /include/net/ipv6.h
parent00494be4546432a11d62ebfeca363256ff9822b5 (diff)
ipv6: Introduce ip6_flow_hdr() to fill version, tclass and flowlabel.
This is not only for readability but also for optimization. What we do here is to build the 32bit word at the beginning of the ipv6 header (the "ip6_flow" virtual member of struct ip6_hdr in RFC3542) and we do not need to read the tclass portion of the target buffer. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r--include/net/ipv6.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 5af66b26ebdd..fcbc6464b014 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -547,6 +547,15 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
547extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); 547extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
548 548
549/* 549/*
550 * Header manipulation
551 */
552static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass,
553 __be32 flowlabel)
554{
555 *(__be32 *)hdr = ntohl(0x60000000 | (tclass << 20)) | flowlabel;
556}
557
558/*
550 * Prototypes exported by ipv6 559 * Prototypes exported by ipv6
551 */ 560 */
552 561