Re: [PATCH] ipmr: ip6mr: Create new sockopt to clear mfc cache only

From: David Miller
Date: Sat Feb 02 2019 - 22:42:35 EST


From: Callum Sinclair <callum.sinclair@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 31 Jan 2019 09:52:09 +1300

>
> -/* Close the multicast socket, and clear the vif tables etc */
> -static void mroute_clean_tables(struct mr_table *mrt, bool all)
> +/* Clear the vif tables */
> +static void mroute_clean_cache(struct mr_table *mrt, bool all)
> {
> - struct net *net = read_pnet(&mrt->net);
> struct mr_mfc *c, *tmp;
> struct mfc_cache *cache;
> - LIST_HEAD(list);
> - int i;
> -
> - /* Shut down all active vif entries */
> - for (i = 0; i < mrt->maxvif; i++) {
> - if (!all && (mrt->vif_table[i].flags & VIFF_STATIC))
> - continue;
> - vif_delete(mrt, i, 0, &list);
> - }
> - unregister_netdevice_many(&list);
> + struct net *net = read_pnet(&mrt->net);

Please do not change the order of local variables like this, you're breaking
the correct reverse christmas tree ordering of longest to shortest line for
local variable declarations.

Thanks.