summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2009-09-12 20:37:44 +0000
committerbms <bms@FreeBSD.org>2009-09-12 20:37:44 +0000
commit9dcdfc82261fcde3c7860795b2ec84136965264a (patch)
tree86a47db8c62c67904c9c6e317b8d8bcdfa62f969 /sys/netinet
parentebe8706174a06183fad21289c48add610ff48252 (diff)
downloadFreeBSD-src-9dcdfc82261fcde3c7860795b2ec84136965264a.zip
FreeBSD-src-9dcdfc82261fcde3c7860795b2ec84136965264a.tar.gz
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
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in_mcast.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c
index 379b38e..e855093 100644
--- a/sys/netinet/in_mcast.c
+++ b/sys/netinet/in_mcast.c
@@ -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 */
OpenPOWER on IntegriCloud