aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2023-01-26 21:55:22 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2023-02-06 22:17:09 +0000
commit6cfb1cf3c9d4cdf9bc39566f6a94bae4a60096c7 (patch)
tree2ae2a56a7165af829fb611466a82aae70bf6bedd
parent6b9f6aeac69b8bffc8db7a23e37fc1a4cdab43b8 (diff)
downloadsrc-6cfb1cf3c9d4cdf9bc39566f6a94bae4a60096c7.tar.gz
src-6cfb1cf3c9d4cdf9bc39566f6a94bae4a60096c7.zip
tcp: improve error handling of net.inet.tcp.udp_tunneling_port
In case the new port can't be set, set the port to 0. Sponsored by: Netflix, Inc. (cherry picked from commit e2d14a04c5fc49ad1aab280e3c2e7283bbacc948)
-rw-r--r--sys/netinet/tcp_subr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 62042df50d18..811e6e10354c 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -843,6 +843,9 @@ sysctl_net_inet_tcp_udp_tunneling_port_check(SYSCTL_HANDLER_ARGS)
}
if (new != 0) {
error = tcp_over_udp_start();
+ if (error != 0) {
+ V_tcp_udp_tunneling_port = 0;
+ }
}
}
}