git: 9c9a76dc6873 - main - mld: always commit state changes on leaving
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 24 Jul 2023 15:45:53 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=9c9a76dc6873427b14f6c84397dd60ea8e529d8d
commit 9c9a76dc6873427b14f6c84397dd60ea8e529d8d
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2023-07-20 07:41:45 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2023-07-24 14:47:34 +0000
mld: always commit state changes on leaving
Resolve a race condition where we'd lose the Solicited-node multicast
group subscription if we assigned the same IPv6 address twice.
PR: 233683
Reviewed by: ae
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D41124
---
sys/netinet6/mld6.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index 63f4e33ac64d..82bb69588fa2 100644
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -2164,13 +2164,10 @@ static void
mld_final_leave(struct in6_multi *inm, struct mld_ifsoftc *mli)
{
struct epoch_tracker et;
- int syncstates;
#ifdef KTR
char ip6tbuf[INET6_ADDRSTRLEN];
#endif
- syncstates = 1;
-
CTR4(KTR_MLD, "%s: final leave %s on ifp %p(%s)",
__func__, ip6_sprintf(ip6tbuf, &inm->in6m_addr),
inm->in6m_ifp, if_name(inm->in6m_ifp));
@@ -2234,7 +2231,6 @@ mld_final_leave(struct in6_multi *inm, struct mld_ifsoftc *mli)
inm->in6m_state = MLD_LEAVING_MEMBER;
inm->in6m_sctimer = 1;
V_state_change_timers_running6 = 1;
- syncstates = 0;
}
break;
}
@@ -2246,15 +2242,13 @@ mld_final_leave(struct in6_multi *inm, struct mld_ifsoftc *mli)
break;
}
- if (syncstates) {
- in6m_commit(inm);
- CTR3(KTR_MLD, "%s: T1 -> T0 for %s/%s", __func__,
- ip6_sprintf(ip6tbuf, &inm->in6m_addr),
- if_name(inm->in6m_ifp));
- inm->in6m_st[1].iss_fmode = MCAST_UNDEFINED;
- CTR3(KTR_MLD, "%s: T1 now MCAST_UNDEFINED for %p/%s",
- __func__, &inm->in6m_addr, if_name(inm->in6m_ifp));
- }
+ in6m_commit(inm);
+ CTR3(KTR_MLD, "%s: T1 -> T0 for %s/%s", __func__,
+ ip6_sprintf(ip6tbuf, &inm->in6m_addr),
+ if_name(inm->in6m_ifp));
+ inm->in6m_st[1].iss_fmode = MCAST_UNDEFINED;
+ CTR3(KTR_MLD, "%s: T1 now MCAST_UNDEFINED for %p/%s",
+ __func__, &inm->in6m_addr, if_name(inm->in6m_ifp));
}
/*