Skip to contentSkip to conversation

dvb_net endianness fix

PATCH New Al Viro 1 participant 1 message Jun 22, 2008 Media (V4L/DVB)

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 dvb_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.

---
 drivers/media/dvb/dvb-core/dvb_net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/dvb/dvb-core/dvb_net.c +1 -1
index c2334ae..ff71610 100644
@@ -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);
Signature · 1 line
1.5.3.GIT