Comment some flawed assumptions in inp_join_group() about

mixing SSM full-state and delta-based APIs.

ENOTIME to fix right now.  No functional changes.

MFC after:	5 days
This commit is contained in:
Bruce M Simpson 2009-09-12 20:37:44 +00:00
parent 0eebc0d7b4
commit fa2eebfce6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=197136

View File

@ -1857,6 +1857,7 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt)
ifp = NULL;
imf = NULL;
lims = NULL;
error = 0;
is_new = 0;
@ -1974,9 +1975,25 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt)
error = EINVAL;
goto out_inp_locked;
}
/* Throw out duplicates. */
/*
* Throw out duplicates.
*
* XXX FIXME: This makes a naive assumption that
* even if entries exist for *ssa in this imf,
* they will be rejected as dupes, even if they
* are not valid in the current mode (in-mode).
*
* in_msource is transactioned just as for anything
* else in SSM -- but note naive use of inm_graft()
* below for allocating new filter entries.
*
* This is only an issue if someone mixes the
* full-state SSM API with the delta-based API,
* which is discouraged in the relevant RFCs.
*/
lims = imo_match_source(imo, idx, &ssa->sa);
if (lims != NULL) {
if (lims != NULL /*&&
lims->imsl_st[1] == MCAST_INCLUDE*/) {
error = EADDRNOTAVAIL;
goto out_inp_locked;
}
@ -2031,6 +2048,8 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt)
*
* Note: Grafting of exclusive mode filters doesn't happen
* in this path.
* XXX: Should check for non-NULL lims (node exists but may
* not be in-mode) for interop with full-state API.
*/
if (ssa->ss.ss_family != AF_UNSPEC) {
/* Membership starts in IN mode */