netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: Fix endianess warning in ip6_flow_hdr().
@ 2013-01-17  3:10 YOSHIFUJI Hideaki
  2013-01-17  3:13 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: YOSHIFUJI Hideaki @ 2013-01-17  3:10 UTC (permalink / raw)
  To: David Miller, netdev; +Cc: fengguang.wu, YOSHIFUJI Hideaki

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: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
---
 include/net/ipv6.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 459a5a4..be3358b 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -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,
 				__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)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipv6: Fix endianess warning in ip6_flow_hdr().
  2013-01-17  3:10 [PATCH] ipv6: Fix endianess warning in ip6_flow_hdr() YOSHIFUJI Hideaki
@ 2013-01-17  3:13 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-01-17  3:13 UTC (permalink / raw)
  To: yoshfuji; +Cc: netdev, fengguang.wu

From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Date: Thu, 17 Jan 2013 12:10:57 +0900

> 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: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-17  3:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17  3:10 [PATCH] ipv6: Fix endianess warning in ip6_flow_hdr() YOSHIFUJI Hideaki
2013-01-17  3:13 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).