netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pasemi_mac: Access iph->tot_len with correct endianness
@ 2008-07-01 17:22 Roland Dreier
  2008-07-02  4:24 ` Olof Johansson
  0 siblings, 1 reply; 2+ messages in thread
From: Roland Dreier @ 2008-07-01 17:22 UTC (permalink / raw)
  To: jeff; +Cc: olof, netdev

iph->tot_len is stored in network byte order, so access it using
ntohs().  This doesn't have any real world impact on pasemi_mac, since
the device only exists as part of a big-endian system-on-chip, but
fixing this gets rid of a sparse warning and avoids having a bad example
in the tree.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
---
 drivers/net/pasemi_mac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 3b2a6c5..993d87c 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -277,7 +277,7 @@ static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
 	*tcph = tcp_hdr(skb);
 
 	/* check if ip header and tcp header are complete */
-	if (iph->tot_len < ip_len + tcp_hdrlen(skb))
+	if (ntohs(iph->tot_len) < ip_len + tcp_hdrlen(skb))
 		return -1;
 
 	*hdr_flags = LRO_IPV4 | LRO_TCP;

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

end of thread, other threads:[~2008-07-02  4:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-01 17:22 [PATCH] pasemi_mac: Access iph->tot_len with correct endianness Roland Dreier
2008-07-02  4:24 ` Olof Johansson

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).