Netdev List
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Pavel Emelyanov <xemul@openvz.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	bridge@lists.osdl.org, Linux Netdev List <netdev@vger.kernel.org>,
	devel@openvz.org
Subject: Re: [PATCH][BRIDGE] Properly dereference the br_should_route_hook
Date: Tue, 27 Nov 2007 08:16:55 -0800	[thread overview]
Message-ID: <20071127081655.40474d79@freepuppy.rosehill> (raw)
In-Reply-To: <474C41DB.4080007@openvz.org>

On Tue, 27 Nov 2007 19:12:11 +0300
Pavel Emelyanov <xemul@openvz.org> wrote:

> This hook is protected with the RCU, so simple
> 
> 	if (br_should_route_hook)
> 		br_should_route_hook(...)
> 
> is not enough on some architectures.
> 
> Use the rcu_dereference/rcu_assign_pointer in this case.
> 
> Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
> 
> ---
> 
> diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
> index 3cedd4e..b42b192 100644
> --- a/net/bridge/br_input.c
> +++ b/net/bridge/br_input.c
> @@ -122,6 +122,7 @@ static inline int is_link_local(const unsigned char *dest)
>  struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
>  {
>  	const unsigned char *dest = eth_hdr(skb)->h_dest;
> +	typeof(br_should_route_hook) rhook;

Okay, but I don't like the typeof() magic. Resubmit with proper declartion.

-- 
Stephen Hemminger <shemminger@linux-foundation.org>

      reply	other threads:[~2007-11-27 16:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-27 16:12 [PATCH][BRIDGE] Properly dereference the br_should_route_hook Pavel Emelyanov
2007-11-27 16:16 ` Stephen Hemminger [this message]

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=20071127081655.40474d79@freepuppy.rosehill \
    --to=shemminger@linux-foundation.org \
    --cc=bridge@lists.osdl.org \
    --cc=devel@openvz.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox