Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140959752
D38644.id117469.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D38644.id117469.diff
View Options
diff --git a/sys/netinet6/in6_proto.c b/sys/netinet6/in6_proto.c
--- a/sys/netinet6/in6_proto.c
+++ b/sys/netinet6/in6_proto.c
@@ -198,6 +198,8 @@
(ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK);
VNET_DEFINE(int, icmp6_nodeinfo_oldmcprefix) = 1;
+VNET_DEFINE(bool, ip6_log_discarded) = 1;
+
/*
* sysctl related items.
*/
@@ -396,3 +398,9 @@
"Ignore the 'IPv6-Only flag' in RA messages in compliance with "
"draft-ietf-6man-ipv6only-flag");
#endif
+
+SYSCTL_BOOL(_net_inet6_ip6, OID_AUTO,
+ log_discarded, CTLFLAG_VNET | CTLFLAG_RW,
+ &VNET_NAME(ip6_log_discarded), 1,
+ "Log packets that can't be forwarded for the reasons outside of "
+ "firewall rules");
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -114,7 +114,8 @@
IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) {
IP6STAT_INC(ip6s_cantforward);
/* XXX in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard) */
- if (V_ip6_log_time + V_ip6_log_interval < time_uptime) {
+ if ((V_ip6_log_time + V_ip6_log_interval < time_uptime) &&
+ V_ip6_log_discarded) {
V_ip6_log_time = time_uptime;
log(LOG_DEBUG,
"cannot forward "
@@ -221,7 +222,8 @@
IP6STAT_INC(ip6s_badscope);
in6_ifstat_inc(nh->nh_ifp, ifs6_in_discard);
- if (V_ip6_log_time + V_ip6_log_interval < time_uptime) {
+ if ((V_ip6_log_time + V_ip6_log_interval < time_uptime) &&
+ V_ip6_log_discarded) {
V_ip6_log_time = time_uptime;
log(LOG_DEBUG,
"cannot forward "
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c
--- a/sys/netinet6/ip6_mroute.c
+++ b/sys/netinet6/ip6_mroute.c
@@ -1099,7 +1099,8 @@
*/
if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) {
IP6STAT_INC(ip6s_cantforward);
- if (V_ip6_log_time + V_ip6_log_interval < time_uptime) {
+ if ((V_ip6_log_time + V_ip6_log_interval < time_uptime) &&
+ V_ip6_log_discarded) {
V_ip6_log_time = time_uptime;
log(LOG_DEBUG,
"cannot forward "
diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h
--- a/sys/netinet6/ip6_var.h
+++ b/sys/netinet6/ip6_var.h
@@ -339,6 +339,9 @@
#define V_nd6_ignore_ipv6_only_ra VNET(nd6_ignore_ipv6_only_ra)
#endif
+VNET_DECLARE(bool, ip6_log_discarded);
+#define V_ip6_log_discarded VNET(ip6_log_discarded)
+
extern struct pr_usrreqs rip6_usrreqs;
struct sockopt;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 31, 3:07 AM (17 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27400853
Default Alt Text
D38644.id117469.diff (2 KB)
Attached To
Mode
D38644: netinet6: allow disabling excess log messages
Attached
Detach File
Event Timeline
Log In to Comment