public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dvb_net endianness fix
@ 2008-06-22 14:20 Al Viro
  0 siblings, 0 replies; only message in thread
From: Al Viro @ 2008-06-22 14:20 UTC (permalink / raw)
  To: mchehab; +Cc: linux-kernel


According to RFC 4326 (4.1) D-bit is MSB in net-endian 16bit.
dvb_net.c did
				/* Set D-bit for CRC32 verification,
				 * if it was set originally. */
				ulen |= 0x0080;
which works of little-endian (htons(1<<15) is 0x0080 there), but breaks
on big-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/media/dvb/dvb-core/dvb_net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index c2334ae..ff71610 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -606,7 +606,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
 			if (priv->ule_dbit) {
 				/* Set D-bit for CRC32 verification,
 				 * if it was set originally. */
-				ulen |= 0x0080;
+				ulen |= htons(0x8000);
 			}
 
 			ule_crc = iov_crc32(ule_crc, iov, 3);
-- 
1.5.3.GIT


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-22 14:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-22 14:20 [PATCH] dvb_net endianness fix Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox