aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2021-10-28 15:11:45 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2021-11-03 20:02:44 +0000
commit3ea9a7cf7b09a355cde3a76824809402b99d0892 (patch)
tree352fbc7f8d68483bbeb27adfb30431863f8f0ab3 /sys/netinet6
parentc47a4a23756167e40c6a9d1dfd0bf64258620171 (diff)
downloadsrc-3ea9a7cf7b09a355cde3a76824809402b99d0892.tar.gz
src-3ea9a7cf7b09a355cde3a76824809402b99d0892.zip
blackhole(4): disable for locally originated TCP/UDP packets
In most cases blackholing for locally originated packets is undesired, leads to different kind of lags and delays. Provide sysctls to enforce it, e.g. for debugging purposes. Reviewed by: rrs Differential revision: https://reviews.freebsd.org/D32718
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/udp6_usrreq.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c
index 6ee2abc4ea1b..5939b631a1ab 100644
--- a/sys/netinet6/udp6_usrreq.c
+++ b/sys/netinet6/udp6_usrreq.c
@@ -511,7 +511,8 @@ skip_checksum:
UDPSTAT_INC(udps_noportmcast);
goto badunlocked;
}
- if (V_udp_blackhole)
+ if (V_udp_blackhole && (V_udp_blackhole_local ||
+ !in6_localaddr(&ip6->ip6_src)))
goto badunlocked;
icmp6_error(m, ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOPORT, 0);
*mp = NULL;