diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2021-10-18 18:36:07 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2021-10-18 18:36:07 +0000 |
commit | 9b7501e7977c1f4a0a4a798cdf0af64846009df8 (patch) | |
tree | a5e89fdc69a105143333872c34e1061aee5a3708 /sys/netinet/in_mcast.c | |
parent | 0f617ae48a911caab3130d0e80cfb425bc3b653b (diff) | |
download | src-9b7501e7977c1f4a0a4a798cdf0af64846009df8.tar.gz src-9b7501e7977c1f4a0a4a798cdf0af64846009df8.zip |
in_mcast: garbage collect inp_gcmoptions()
It is is used only once, merge it into inp_freemoptions().
Diffstat (limited to 'sys/netinet/in_mcast.c')
-rw-r--r-- | sys/netinet/in_mcast.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index ad2d7af799a5..f307be283e64 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -1588,13 +1588,16 @@ inp_findmoptions(struct inpcb *inp) return (imo); } -static void -inp_gcmoptions(struct ip_moptions *imo) +void +inp_freemoptions(struct ip_moptions *imo) { struct in_mfilter *imf; struct in_multi *inm; struct ifnet *ifp; + if (imo == NULL) + return; + while ((imf = ip_mfilter_first(&imo->imo_head)) != NULL) { ip_mfilter_remove(&imo->imo_head, imf); @@ -1614,20 +1617,6 @@ inp_gcmoptions(struct ip_moptions *imo) } /* - * Discard the IP multicast options (and source filters). To minimize - * the amount of work done while holding locks such as the INP's - * pcbinfo lock (which is used in the receive path), the free - * operation is deferred to the epoch callback task. - */ -void -inp_freemoptions(struct ip_moptions *imo) -{ - if (imo == NULL) - return; - inp_gcmoptions(imo); -} - -/* * Atomically get source filters on a socket for an IPv4 multicast group. * Called with INP lock held; returns with lock released. */ |