All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Gao feng <gaofeng@cn.fujitsu.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH RESEND] netfilter: bridge: unshare bridge info before change it
Date: Tue, 18 Nov 2014 19:34:19 +0100	[thread overview]
Message-ID: <20141118183419.GA5078@salvia> (raw)
In-Reply-To: <1416203323-22745-1-git-send-email-gaofeng@cn.fujitsu.com>

On Mon, Nov 17, 2014 at 01:48:43PM +0800, Gao feng wrote:
> diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
> index 1a4f32c..b4612b9 100644
> --- a/net/bridge/br_netfilter.c
> +++ b/net/bridge/br_netfilter.c
> @@ -653,7 +643,11 @@ static int br_nf_forward_finish(struct sk_buff *skb)
>  		in = nf_bridge->physindev;
>  		if (nf_bridge->mask & BRNF_PKT_TYPE) {
>  			skb->pkt_type = PACKET_OTHERHOST;
> -			nf_bridge->mask ^= BRNF_PKT_TYPE;
> +
> +			if (!nf_bridge_unset_mask(skb, BRNF_PKT_TYPE)) {
> +				kfree_skb(skb);
> +				return 0;
> +			}

This can now release the packet and, thus, drop it.

However, br_nf_forward_ip() always returns NF_STOLEN.

Could you revisit the error paths and confirm they are correct?

Thanks.

>  		}
>  		nf_bridge_update_protocol(skb);
>  	} else {

  reply	other threads:[~2014-11-18 18:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17  5:48 [PATCH RESEND] netfilter: bridge: unshare bridge info before change it Gao feng
2014-11-18 18:34 ` Pablo Neira Ayuso [this message]
2014-11-19  2:11   ` Gao feng
2014-11-19 11:17     ` Pablo Neira Ayuso
2014-11-19 11:49       ` Pablo Neira Ayuso
2014-11-20  1:14         ` Gao feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141118183419.GA5078@salvia \
    --to=pablo@netfilter.org \
    --cc=gaofeng@cn.fujitsu.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.