]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: mvpp2: Use htons when checking protocol info
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Thu, 28 Jun 2018 12:42:07 +0000 (14:42 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 Jun 2018 09:54:09 +0000 (18:54 +0900)
When checking the skb->protocol field, we have to make sure we use the
proper endianness using htons, and not swab16.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

index ded187a20b6cf225e8739acb623e585ef23e0c9f..88f3da184d764e5fb155709a1c5235d1872cbf4b 100644 (file)
@@ -1738,7 +1738,7 @@ static u32 mvpp2_txq_desc_csum(int l3_offs, int l3_proto,
        command |= (ip_hdr_len << MVPP2_TXD_IP_HLEN_SHIFT);
        command |= MVPP2_TXD_IP_CSUM_DISABLE;
 
-       if (l3_proto == swab16(ETH_P_IP)) {
+       if (l3_proto == htons(ETH_P_IP)) {
                command &= ~MVPP2_TXD_IP_CSUM_DISABLE;  /* enable IPv4 csum */
                command &= ~MVPP2_TXD_L3_IP6;           /* enable IPv4 */
        } else {