V4L/DVB (8126): net endianness fix
authorAl Viro <viro@ftp.linux.org.uk>
Sun, 22 Jun 2008 17:20:49 +0000 (14:20 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 20 Jul 2008 10:13:08 +0000 (07:13 -0300)
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/dvb-core/dvb_net.c

index c2334aef4143f318813681587f2638870daf35a7..ff7161094023cd577eb4671112aea24f3dfaf228 100644 (file)
@@ -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);