Messages in this thread | | | Subject | Re: [PATCH net-next v5] ipmr: ip6mr: Create new sockopt to clear mfc cache or vifs | From | Nicolas Dichtel <> | Date | Thu, 14 Feb 2019 15:16:14 +0100 |
| |
Le 14/02/2019 à 03:44, Callum Sinclair a écrit : > Currently the only way to clear the forwarding cache was to delete the > entries one by one using the MRT_DEL_MFC socket option or to destroy and > recreate the socket. > > Create a new socket option which with the use of optional flags can > clear any combination of multicast entries (static or not static) and > multicast vifs (static or not static). > > Calling the new socket option MRT_FLUSH with the flags MRT_FLUSH_MFC and > MRT_FLUSH_VIFS will clear all entries and vifs on the socket except for > static entries. > > Signed-off-by: Callum Sinclair <callum.sinclair@alliedtelesis.co.nz> Except two minor comments (see below), Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
[snip]
> +/* MRT6_FLUSH optional flags */ > +#define MRT6_FLUSH_MFC 1 /* Flush multicast entries */ > +#define MRT6_FLUSH_MFC_STATIC 2 /* Flush static multicast entries */ > +#define MRT6_FLUSH_VIFS 4 /* Flushing multicast vifs */ > +#define MRT6_FLUSH_VIFS_STATIC 8 /* Flush static multicast vifs */ vifs are called mifs in ipv6, maybe it's better to keep the consistency with MRT6_FLUSH_MIFS and MRT6_FLUSH_MIFS_STATIC.
[snip]
> + if (flags & (MRT6_FLUSH_MFC | MRT6_FLUSH_MFC_STATIC)) { > + list_for_each_entry_safe(c, tmp, &mrt->mfc_cache_list, list) { > + if (((c->mfc_flags & MFC_STATIC) && !(flags & MRT6_FLUSH_MFC_STATIC)) || > + (!(c->mfc_flags & MFC_STATIC) && !(flags & MRT6_FLUSH_MFC))) > + continue; > + rhltable_remove(&mrt->mfc_hash, &c->mnode, ip6mr_rht_params); > + list_del_rcu(&c->list); > + call_ip6mr_mfc_entry_notifiers(read_pnet(&mrt->net), > + FIB_EVENT_ENTRY_DEL, > + (struct mfc6_cache *)c, mrt->id); Two many tabs here.
Regards, Nicolas
| |