git: 5b0010b4678d - main - if_tuntap: fix NOIP build
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 04 Dec 2023 18:19:13 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=5b0010b4678d778967a5a82fb38507e46a071e38
commit 5b0010b4678d778967a5a82fb38507e46a071e38
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2023-12-04 18:18:56 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2023-12-04 18:18:56 +0000
if_tuntap: fix NOIP build
Note: this removes one TUNDEBUG() for the sake of not having one more
ifdefed variable declaration and for the overall code brevity. The call
from tuntap into LRO can be so easily traced with dtrace(1) that an
80-ish printf(9)-based debugging can be omitted.
Fixes: 99c79cab422705f92f05a2924a29bdf823372ebf
---
sys/net/if_tuntap.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c
index 5a4231604f5a..fccc666e2a00 100644
--- a/sys/net/if_tuntap.c
+++ b/sys/net/if_tuntap.c
@@ -1178,13 +1178,13 @@ tundtor(void *data)
if ((tp->tun_flags & TUN_VMNET) != 0 ||
(l2tun && (ifp->if_flags & IFF_LINK0) != 0))
goto out;
-
+#if defined(INET) || defined(INET6)
if (l2tun && tp->tun_lro_ready) {
TUNDEBUG (ifp, "LRO disabled\n");
tcp_lro_free(&tp->tun_lro);
tp->tun_lro_ready = false;
}
-
+#endif
if (ifp->if_flags & IFF_UP) {
TUN_UNLOCK(tp);
if_down(ifp);
@@ -1229,6 +1229,7 @@ tuninit(struct ifnet *ifp)
getmicrotime(&ifp->if_lastchange);
TUN_UNLOCK(tp);
} else {
+#if defined(INET) || defined(INET6)
if (tcp_lro_init(&tp->tun_lro) == 0) {
TUNDEBUG(ifp, "LRO enabled\n");
tp->tun_lro.ifp = ifp;
@@ -1237,6 +1238,7 @@ tuninit(struct ifnet *ifp)
TUNDEBUG(ifp, "Could not enable LRO\n");
tp->tun_lro_ready = false;
}
+#endif
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
TUN_UNLOCK(tp);
/* attempt to start output */
@@ -1783,7 +1785,6 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m,
struct epoch_tracker et;
struct ether_header *eh;
struct ifnet *ifp;
- int result;
ifp = TUN2IFP(tp);
@@ -1839,14 +1840,12 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m,
/* Pass packet up to parent. */
CURVNET_SET(ifp->if_vnet);
NET_EPOCH_ENTER(et);
- if (tp->tun_lro_ready && ifp->if_capenable & IFCAP_LRO) {
- result = tcp_lro_rx(&tp->tun_lro, m, 0);
- TUNDEBUG(ifp, "tcp_lro_rx() returned %d\n", result);
- } else
- result = TCP_LRO_CANNOT;
- if (result == 0)
+#if defined(INET) || defined(INET6)
+ if (tp->tun_lro_ready && ifp->if_capenable & IFCAP_LRO &&
+ tcp_lro_rx(&tp->tun_lro, m, 0) == 0)
tcp_lro_flush_all(&tp->tun_lro);
else
+#endif
(*ifp->if_input)(ifp, m);
NET_EPOCH_EXIT(et);
CURVNET_RESTORE();