Skip to content

Commit 505a691

Browse files
author
mvs
committed
Unlock ICMPV6CTL_ND6_DELAY case of icmp6_sysctl().
`nd6_delay' loaded only once in nd6_resolve(). ok bluhm
1 parent 831436a commit 505a691

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

sys/netinet6/icmp6.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: icmp6.c,v 1.272 2025/08/02 09:03:54 mvs Exp $ */
1+
/* $OpenBSD: icmp6.c,v 1.273 2025/08/02 12:53:04 mvs Exp $ */
22
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
33

44
/*
@@ -1774,8 +1774,11 @@ icmp6_mtudisc_timeout(struct rtentry *rt, u_int rtableid)
17741774
}
17751775

17761776
#ifndef SMALL_KERNEL
1777-
const struct sysctl_bounded_args icmpv6ctl_vars[] = {
1777+
const struct sysctl_bounded_args icmpv6ctl_vars_unlocked[] = {
17781778
{ ICMPV6CTL_ND6_DELAY, &nd6_delay, 0, INT_MAX },
1779+
};
1780+
1781+
const struct sysctl_bounded_args icmpv6ctl_vars[] = {
17791782
{ ICMPV6CTL_ND6_UMAXTRIES, &nd6_umaxtries, 0, INT_MAX },
17801783
{ ICMPV6CTL_ND6_MMAXTRIES, &nd6_mmaxtries, 0, INT_MAX },
17811784
{ ICMPV6CTL_ERRPPSLIMIT, &icmp6errppslim, -1, 1000 },
@@ -1843,6 +1846,12 @@ icmp6_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
18431846
atomic_load_int(&ln_hold_total));
18441847
break;
18451848

1849+
case ICMPV6CTL_ND6_DELAY:
1850+
error = sysctl_bounded_arr(icmpv6ctl_vars_unlocked,
1851+
nitems(icmpv6ctl_vars_unlocked), name, namelen,
1852+
oldp, oldlenp, newp, newlen);
1853+
break;
1854+
18461855
default:
18471856
NET_LOCK();
18481857
error = sysctl_bounded_arr(icmpv6ctl_vars,

sys/netinet6/nd6.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: nd6.c,v 1.293 2025/07/26 01:16:59 mvs Exp $ */
1+
/* $OpenBSD: nd6.c,v 1.294 2025/08/02 12:53:04 mvs Exp $ */
22
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
33

44
/*
@@ -75,7 +75,7 @@
7575
/* timer values */
7676
int nd6_timer_next = -1; /* at which uptime nd6_timer runs */
7777
time_t nd6_expire_next = -1; /* at which uptime nd6_expire runs */
78-
int nd6_delay = 5; /* delay first probe time 5 second */
78+
int nd6_delay = 5; /* [a] delay first probe time 5 second */
7979
int nd6_umaxtries = 3; /* maximum unicast query */
8080
int nd6_mmaxtries = 3; /* maximum multicast query */
8181
int nd6_gctimer = (60 * 60 * 24); /* 1 day: garbage collection timer */
@@ -1307,7 +1307,7 @@ nd6_resolve(struct ifnet *ifp, struct rtentry *rt0, struct mbuf *m,
13071307
if (ln->ln_state == ND6_LLINFO_STALE) {
13081308
ln->ln_asked = 0;
13091309
ln->ln_state = ND6_LLINFO_DELAY;
1310-
nd6_llinfo_settimer(ln, nd6_delay);
1310+
nd6_llinfo_settimer(ln, atomic_load_int(&nd6_delay));
13111311
}
13121312

13131313
/*

0 commit comments

Comments
 (0)