ktls: Fix capability checks in ktls_reset_receive_tag()

IFCAP2_RXTLS4 and IFCAP2_RXTLS6 are bit numbers, not masks, so
ktls_reset_receive_tag() tested if_capenable2 against 0 for IPv4 and against the
RXTLS4 bit for IPv6. An IPv4 connection with NIC receive TLS offload thus never
got a new receive tag after its packets moved to another interface, and fell
back to software decryption for good.
c721694 fixed the same checks in ktls_alloc_rcv_tag(); use IFCAP2_BIT() here
as well.

Fixes: fe8c78f ("ktls: Add full support for TLS RX offloading via network interface.")

Approved by:	gallatin, kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D60757
This commit is contained in:
Olivier Cochard committed 2026-10-16 06:40:03 +02:00
1 parent c9599b8001
commit 32a981471c
1 file changed
+2 -2
+2 -2
View File
@@ -1708,10 +1708,10 @@ ktls_reset_receive_tag(void *context, int pending)
INP_RUNLOCK(inp);
if (inp->inp_vflag & INP_IPV6) {
if ((if_getcapenable2(ifp) & IFCAP2_RXTLS6) == 0)
if ((if_getcapenable2(ifp) & IFCAP2_BIT(IFCAP2_RXTLS6)) == 0)
goto out;
} else {
if ((if_getcapenable2(ifp) & IFCAP2_RXTLS4) == 0)
if ((if_getcapenable2(ifp) & IFCAP2_BIT(IFCAP2_RXTLS4)) == 0)
goto out;
}