From f51b10ef6520f2bd725dc333e771eabd55d6c04f Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 22 Jun 2008 14:20:49 -0300 Subject: [PATCH] V4L/DVB (8126): net endianness fix 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-core/dvb_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c index c2334aef4143..ff7161094023 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); -- 2.20.1