git: f3245be3499b - main - net: remove legacy in_addmulti()

Kristof Provost kp at FreeBSD.org
Thu Feb 25 12:31:17 UTC 2021


The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=f3245be3499b60e790f59f84ebe24f9cc91dd982

commit f3245be3499b60e790f59f84ebe24f9cc91dd982
Author:     Kristof Provost <kp at FreeBSD.org>
AuthorDate: 2021-02-23 19:21:19 +0000
Commit:     Kristof Provost <kp at FreeBSD.org>
CommitDate: 2021-02-25 09:13:52 +0000

    net: remove legacy in_addmulti()
    
    Despite the comment to the contrary neither pf nor carp use
    in_addmulti(). Nothing does, so get rid of it.
    
    Carp stopped using it in 08b68b0e4c6b132127919cfbaf7275c727ca7843
    (2011). It's unclear when pf stopped using it, but before
    d6d3f01e0a3395c1fae34a3c4be7b051cb2d7581 (2012).
    
    Reviewed by:    bz@, melifaro@
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D28918
---
 sys/netinet/in_mcast.c | 29 -----------------------------
 sys/netinet/in_var.h   |  2 --
 2 files changed, 31 deletions(-)

diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c
index 6d390a0b263c..392856785dd2 100644
--- a/sys/netinet/in_mcast.c
+++ b/sys/netinet/in_mcast.c
@@ -120,8 +120,6 @@ int ifma_restart;
  * Functions with non-static linkage defined in this file should be
  * declared in in_var.h:
  *  imo_multi_filter()
- *  in_addmulti()
- *  in_delmulti()
  *  in_joingroup()
  *  in_joingroup_locked()
  *  in_leavegroup()
@@ -130,9 +128,6 @@ int ifma_restart;
  *  inp_freemoptions()
  *  inp_getmoptions()
  *  inp_setmoptions()
- *
- * XXX: Both carp and pf need to use the legacy (*,G) KPIs in_addmulti()
- * and in_delmulti().
  */
 static void	imf_commit(struct in_mfilter *);
 static int	imf_get_source(struct in_mfilter *imf,
@@ -1367,30 +1362,6 @@ in_leavegroup_locked(struct in_multi *inm, /*const*/ struct in_mfilter *imf)
 }
 
 /*#ifndef BURN_BRIDGES*/
-/*
- * Join an IPv4 multicast group in (*,G) exclusive mode.
- * The group must be a 224.0.0.0/24 link-scope group.
- * This KPI is for legacy kernel consumers only.
- */
-struct in_multi *
-in_addmulti(struct in_addr *ap, struct ifnet *ifp)
-{
-	struct in_multi *pinm;
-	int error;
-#ifdef INVARIANTS
-	char addrbuf[INET_ADDRSTRLEN];
-#endif
-
-	KASSERT(IN_LOCAL_GROUP(ntohl(ap->s_addr)),
-	    ("%s: %s not in 224.0.0.0/24", __func__,
-	    inet_ntoa_r(*ap, addrbuf)));
-
-	error = in_joingroup(ifp, ap, NULL, &pinm);
-	if (error != 0)
-		pinm = NULL;
-
-	return (pinm);
-}
 
 /*
  * Block or unblock an ASM multicast source on an inpcb.
diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h
index c7ebff80e56d..b42ca00d5ae7 100644
--- a/sys/netinet/in_var.h
+++ b/sys/netinet/in_var.h
@@ -450,8 +450,6 @@ int	inm_record_source(struct in_multi *inm, const in_addr_t);
 void	inm_release_deferred(struct in_multi *);
 void	inm_release_list_deferred(struct in_multi_head *);
 void	inm_release_wait(void *);
-struct	in_multi *
-in_addmulti(struct in_addr *, struct ifnet *);
 int	in_joingroup(struct ifnet *, const struct in_addr *,
 	    /*const*/ struct in_mfilter *, struct in_multi **);
 int	in_joingroup_locked(struct ifnet *, const struct in_addr *,


More information about the dev-commits-src-all mailing list