Skip to content

Commit

Permalink
V4L/DVB (8126): net endianness fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro authored and Mauro Carvalho Chehab committed Jul 20, 2008
1 parent 38f993a commit f51b10e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/dvb/dvb-core/dvb_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f51b10e

Please sign in to comment.