Commit 07f623d3 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller

ipv6: Fix endianess warning in ip6_flow_hdr().

Commit 3e4e4c1f ("ipv6: Introduce ip6_flow_hdr() to fill version,
tclass and flowlabel.) uses ntohl(), which should be htonl().

Found by Fengguang Wu <fengguang.wu@intel.com>.
Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9fba0812
...@@ -629,7 +629,7 @@ extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); ...@@ -629,7 +629,7 @@ extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass, static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass,
__be32 flowlabel) __be32 flowlabel)
{ {
*(__be32 *)hdr = ntohl(0x60000000 | (tclass << 20)) | flowlabel; *(__be32 *)hdr = htonl(0x60000000 | (tclass << 20)) | flowlabel;
} }
static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr) static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment