Netdev List
 help / color / mirror / Atom feed
* [PATCH net v1] tap: fix incorrect variable used for USO check in set_offload()
@ 2026-08-05  7:21 Rongguang Wei
  2026-08-05 13:34 ` Willem de Bruijn
  2026-08-06 16:39 ` Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Rongguang Wei @ 2026-08-05  7:21 UTC (permalink / raw)
  To: netdev; +Cc: willemdebruijn.kernel, jasowangio, andrew+netdev, Rongguang Wei

From: Rongguang Wei <weirongguang@kylinos.cn>

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 <weirongguang@kylinos.cn>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-06 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05  7:21 [PATCH net v1] tap: fix incorrect variable used for USO check in set_offload() Rongguang Wei
2026-08-05 13:34 ` Willem de Bruijn
2026-08-06 16:39 ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox