diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index a3298e655bc..7b9383d728b 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icmp6.c,v 1.274 2025/08/03 11:08:40 mvs Exp $ */ +/* $OpenBSD: icmp6.c,v 1.275 2025/08/03 11:12:58 mvs Exp $ */ /* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */ /* @@ -1292,7 +1292,6 @@ icmp6_redirect_input(struct mbuf *m, int off) struct sockaddr_in6 ssrc; unsigned long rtcount; struct rtentry *newrt = NULL; - int ip6_maxdynroutes_local = atomic_load_int(&ip6_maxdynroutes); /* * do not install redirect route, if the number of entries @@ -1301,8 +1300,7 @@ icmp6_redirect_input(struct mbuf *m, int off) * (there will be additional hops, though). */ rtcount = rt_timer_queue_count(&icmp6_redirect_timeout_q); - if (ip6_maxdynroutes_local >= 0 && - rtcount >= ip6_maxdynroutes_local) + if (rtcount >= atomic_load_int(&ip6_maxdynroutes)) goto freeit; bzero(&sdst, sizeof(sdst)); diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 344a8c19748..e6a5fbc0404 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_input.c,v 1.295 2025/08/03 04:11:57 mvs Exp $ */ +/* $OpenBSD: ip6_input.c,v 1.296 2025/08/03 11:12:58 mvs Exp $ */ /* $KAME: ip6_input.c,v 1.188 2001/03/29 05:34:31 itojun Exp $ */ /* @@ -1460,7 +1460,7 @@ const struct sysctl_bounded_args ipv6ctl_vars[] = { { IPV6CTL_MFORWARDING, &ip6_mforwarding, 0, 1 }, { IPV6CTL_MCAST_PMTU, &ip6_mcast_pmtu, 0, 1 }, { IPV6CTL_NEIGHBORGCTHRESH, &ip6_neighborgcthresh, 0, 5 * 2048 }, - { IPV6CTL_MAXDYNROUTES, &ip6_maxdynroutes, -1, 5 * 4096 }, + { IPV6CTL_MAXDYNROUTES, &ip6_maxdynroutes, 0, 5 * 4096 }, }; int