[PATCH net v1] tap: fix incorrect variable used for USO check in set_offload()

Rongguang Wei <[email protected]>
Newsgroups org.kernel.vger.netdev
Message-ID <[email protected]>
From: Rongguang Wei <[email protected]>

The USO features in set_offload() incorrectly uses feature_mask
instead of arg argument.

TUN_F_USO4 and TUN_F_USO6 belong to the TUN_F_* flag, while feature_mask
belong to NETIF_F_* values (NETIF_F_HW_CSUM, NETIF_F_TSO, etc.) and
will never contain any TUN_F_* bits.

Fixes: 399e0827642f ("driver/net/tun: Added features for USO.")
Signed-off-by: Rongguang Wei <[email protected]>
---
 drivers/net/tap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index fae115915c8e..ce25ebeeccf0 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -895,7 +895,7 @@ static int set_offload(struct tap_queue *q, unsigned long arg)
 	 * user-space will not receive TSO frames.
 	 */
 	if (feature_mask & (NETIF_F_TSO | NETIF_F_TSO6) ||
-	    (feature_mask & (TUN_F_USO4 | TUN_F_USO6)) == (TUN_F_USO4 | TUN_F_USO6))
+	    (arg & (TUN_F_USO4 | TUN_F_USO6)) == (TUN_F_USO4 | TUN_F_USO6))
 		features |= RX_OFFLOADS;
 	else
 		features &= ~RX_OFFLOADS;
-- 
2.25.1


No virus found
		Checked by Hillstone Network AntiVirus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.