提交 f51b10ef 编写于 作者: A Al Viro 提交者: Mauro Carvalho Chehab

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: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 38f993ad
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册