lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f9f4dbfa-81aa-f88f-3e06-bd29acc25b19@gmail.com>
Date:   Wed, 27 Oct 2021 09:08:27 -0600
From:   David Ahern <dsahern@...il.com>
To:     Taehee Yoo <ap420073@...il.com>, davem@...emloft.net,
        kuba@...nel.org, dsahern@...nel.org, netdev@...r.kernel.org
Cc:     dkirjanov@...e.de
Subject: Re: [PATCH net-next 3/4 v4] amt: add multicast(IGMP) report message
 handler

On 10/26/21 9:10 AM, Taehee Yoo wrote:
> +static bool amt_status_filter(struct amt_source_node *snode,
> +			      enum amt_filter filter)
> +{

How about:
	bool rc = false;

and then

> +	switch (filter) {
> +	case AMT_FILTER_FWD:
> +		if (snode->status == AMT_SOURCE_STATUS_FWD &&
> +		    snode->flags == AMT_SOURCE_OLD)
> +			rc = true;
> +		break;
similar change for the rest of the cases.

> +	case AMT_FILTER_D_FWD:
> +		if (snode->status == AMT_SOURCE_STATUS_D_FWD &&
> +		    snode->flags == AMT_SOURCE_OLD)
> +			return true;
> +		else
> +			return false;
> +	case AMT_FILTER_FWD_NEW:
> +		if (snode->status == AMT_SOURCE_STATUS_FWD &&
> +		    snode->flags == AMT_SOURCE_NEW)
> +			return true;
> +		else
> +			return false;
> +	case AMT_FILTER_D_FWD_NEW:
> +		if (snode->status == AMT_SOURCE_STATUS_D_FWD &&
> +		    snode->flags == AMT_SOURCE_NEW)
> +			return true;
> +		else
> +			return false;
> +	case AMT_FILTER_ALL:
> +		return true;
> +	case AMT_FILTER_NONE_NEW:
> +		if (snode->status == AMT_SOURCE_STATUS_NONE &&
> +		    snode->flags == AMT_SOURCE_NEW)
> +			return true;
> +		else
> +			return false;
> +	case AMT_FILTER_BOTH:
> +		if ((snode->status == AMT_SOURCE_STATUS_D_FWD ||
> +		     snode->status == AMT_SOURCE_STATUS_FWD) &&
> +		    snode->flags == AMT_SOURCE_OLD)
> +			return true;
> +		else
> +			return false;
> +	case AMT_FILTER_BOTH_NEW:
> +		if ((snode->status == AMT_SOURCE_STATUS_D_FWD ||
> +		     snode->status == AMT_SOURCE_STATUS_FWD) &&
> +		    snode->flags == AMT_SOURCE_NEW)
> +			return true;
> +		else
> +			return false;
> +	default:
> +		return false;
> +	}
> +
> +	return false;
> +}
> +


> +
> +/* If a source timer expires with a router filter-mode for the group of
> + * INCLUDE, the router concludes that traffic from this particular
> + * source is no longer desired on the attached network, and deletes the
> + * associated source record.
> + */
> +static void amt_source_work(struct work_struct *work)
> +{
> +	struct amt_source_node *snode = container_of(to_delayed_work(work),
> +						     struct amt_source_node,
> +						     source_timer);
> +	struct amt_group_node *gnode = snode->gnode;
> +	struct amt_dev *amt = gnode->amt;
> +	struct amt_tunnel_list *tunnel;
> +
> +	tunnel = gnode->tunnel_list;
> +	spin_lock_bh(&tunnel->lock);
> +	rcu_read_lock();
> +	if (gnode->filter_mode == MCAST_INCLUDE) {
> +		amt_destroy_source(snode);
> +		if (!gnode->nr_sources)
> +			amt_del_group(amt, gnode);
> +	} else {
> +/* When a router filter-mode for a group is EXCLUDE, source records are
> + * only deleted when the group timer expires
> + */

comment needs to be indented.

> +		snode->status = AMT_SOURCE_STATUS_D_FWD;
> +	}
> +	rcu_read_unlock();
> +	spin_unlock_bh(&tunnel->lock);
> +}
> +


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ