From 7eeb079d84bc4abe9897be0047fc28a754e46ecd Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 2 Feb 2015 14:27:13 +0100 Subject: Update to FreeBSD 9.3 --- freebsd/sys/netinet6/in6_mcast.c | 69 +++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 36 deletions(-) (limited to 'freebsd/sys/netinet6/in6_mcast.c') diff --git a/freebsd/sys/netinet6/in6_mcast.c b/freebsd/sys/netinet6/in6_mcast.c index 55f2fab2..e5457707 100644 --- a/freebsd/sys/netinet6/in6_mcast.c +++ b/freebsd/sys/netinet6/in6_mcast.c @@ -133,7 +133,9 @@ static int in6_mc_get(struct ifnet *, const struct in6_addr *, static int in6m_get_source(struct in6_multi *inm, const struct in6_addr *addr, const int noalloc, struct ip6_msource **pims); +#ifdef KTR static int in6m_is_ifp_detached(const struct in6_multi *); +#endif static int in6m_merge(struct in6_multi *, /*const*/ struct in6_mfilter *); static void in6m_purge(struct in6_multi *); static void in6m_reap(struct in6_multi *); @@ -177,6 +179,7 @@ static SYSCTL_NODE(_net_inet6_ip6_mcast, OID_AUTO, filters, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_ip6_mcast_filters, "Per-interface stack-wide source filters"); +#ifdef KTR /* * Inline function which wraps assertions for a valid ifp. * The ifnet layer will set the ifma's ifp pointer to NULL if the ifp @@ -199,6 +202,7 @@ in6m_is_ifp_detached(const struct in6_multi *inm) return (ifp == NULL); } +#endif /* * Initialize an in6_mfilter structure to a known state at t0, t1 @@ -1447,16 +1451,15 @@ in6p_block_unblock_source(struct inpcb *inp, struct sockopt *sopt) CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", __func__); } - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) - CTR1(KTR_MLD, "%s: failed mld downcall", __func__); - IN6_MULTI_UNLOCK(); out_im6f_rollback: @@ -2044,29 +2047,27 @@ in6p_join_group(struct inpcb *inp, struct sockopt *sopt) if (is_new) { error = in6_mc_join_locked(ifp, &gsa->sin6.sin6_addr, imf, &inm, 0); - if (error) + if (error) { + IN6_MULTI_UNLOCK(); goto out_im6o_free; + } imo->im6o_membership[idx] = inm; } else { CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; - } - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) { - CTR1(KTR_MLD, "%s: failed mld downcall", - __func__); - goto out_im6f_rollback; + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", + __func__); } } IN6_MULTI_UNLOCK(); - -out_im6f_rollback: INP_WLOCK_ASSERT(inp); if (error) { im6f_rollback(imf); @@ -2293,23 +2294,20 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *sopt) } else { CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; - } - - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) { - CTR1(KTR_MLD, "%s: failed mld downcall", - __func__); + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", + __func__); } } IN6_MULTI_UNLOCK(); -out_im6f_rollback: if (error) im6f_rollback(imf); else @@ -2518,16 +2516,15 @@ in6p_set_source_filters(struct inpcb *inp, struct sockopt *sopt) */ CTR1(KTR_MLD, "%s: merge inm state", __func__); error = in6m_merge(inm, imf); - if (error) { + if (error) CTR1(KTR_MLD, "%s: failed to merge inm state", __func__); - goto out_im6f_rollback; + else { + CTR1(KTR_MLD, "%s: doing mld downcall", __func__); + error = mld_change_state(inm, 0); + if (error) + CTR1(KTR_MLD, "%s: failed mld downcall", __func__); } - CTR1(KTR_MLD, "%s: doing mld downcall", __func__); - error = mld_change_state(inm, 0); - if (error) - CTR1(KTR_MLD, "%s: failed mld downcall", __func__); - IN6_MULTI_UNLOCK(); out_im6f_rollback: -- cgit v1.2.3