All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Veaceslav Falico <vfalico@redhat.com>
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org
Subject: Re: mac addresses of local interfaces do not obey setageing 0
Date: Tue, 15 Feb 2011 10:25:38 -0800	[thread overview]
Message-ID: <20110215102538.5f24d62a@nehalam> (raw)
In-Reply-To: <20110209181752.GA2042@darkmag.usersys.redhat.com>

On Wed, 9 Feb 2011 19:17:52 +0100
Veaceslav Falico <vfalico@redhat.com> wrote:

> Hello,
> 
> I have a host and a VM inside this host bridged. I've set ageing_time and
> forward_delay to 0 and trying to capture all the traffic that goes through that
> bridge from my VM, but it fails to capture the traffic that has dst ether
> address the same as the hosts address (i.e. I can't capture the traffic to the
> host).
> 
> From the code, I see that br->ageing_time doesn't really work with local mac
> addresses - has_expired() function never says that a local interface mac address
> is expired, because it verifies if fdb->is_static is set and returns right away.
> 
> Is this the desired behaviour? If so, is there a way to capture packets with
> destination to a local interface from another interface?
> 
> I've also done a small patch and it seems to fix the situation, but I am not
> sure if it's the right way to do it.
> 
> 
> Regards,
> Veaceslav
> 
> ---
>  net/bridge/br_fdb.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
> index 88485cc..3d380c2 100644
> --- a/net/bridge/br_fdb.c
> +++ b/net/bridge/br_fdb.c
> @@ -61,8 +61,8 @@ static inline unsigned long hold_time(const struct net_bridge *br)
>  static inline int has_expired(const struct net_bridge *br,
>  				  const struct net_bridge_fdb_entry *fdb)
>  {
> -	return !fdb->is_static &&
> -		time_before_eq(fdb->ageing_timer + hold_time(br), jiffies);
> +	return (br->ageing_time == 0) || (!fdb->is_static &&
> +		time_before_eq(fdb->ageing_timer + hold_time(br), jiffies));
>  }
>  

No.
Local addresses should never age.

The proper way to capture packet is to us AF_PACKET or tc actions.
-- 

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Hemminger <shemminger@vyatta.com>
To: Veaceslav Falico <vfalico@redhat.com>
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org
Subject: Re: [Bridge] mac addresses of local interfaces do not obey setageing 0
Date: Tue, 15 Feb 2011 10:25:38 -0800	[thread overview]
Message-ID: <20110215102538.5f24d62a@nehalam> (raw)
In-Reply-To: <20110209181752.GA2042@darkmag.usersys.redhat.com>

On Wed, 9 Feb 2011 19:17:52 +0100
Veaceslav Falico <vfalico@redhat.com> wrote:

> Hello,
> 
> I have a host and a VM inside this host bridged. I've set ageing_time and
> forward_delay to 0 and trying to capture all the traffic that goes through that
> bridge from my VM, but it fails to capture the traffic that has dst ether
> address the same as the hosts address (i.e. I can't capture the traffic to the
> host).
> 
> From the code, I see that br->ageing_time doesn't really work with local mac
> addresses - has_expired() function never says that a local interface mac address
> is expired, because it verifies if fdb->is_static is set and returns right away.
> 
> Is this the desired behaviour? If so, is there a way to capture packets with
> destination to a local interface from another interface?
> 
> I've also done a small patch and it seems to fix the situation, but I am not
> sure if it's the right way to do it.
> 
> 
> Regards,
> Veaceslav
> 
> ---
>  net/bridge/br_fdb.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
> index 88485cc..3d380c2 100644
> --- a/net/bridge/br_fdb.c
> +++ b/net/bridge/br_fdb.c
> @@ -61,8 +61,8 @@ static inline unsigned long hold_time(const struct net_bridge *br)
>  static inline int has_expired(const struct net_bridge *br,
>  				  const struct net_bridge_fdb_entry *fdb)
>  {
> -	return !fdb->is_static &&
> -		time_before_eq(fdb->ageing_timer + hold_time(br), jiffies);
> +	return (br->ageing_time == 0) || (!fdb->is_static &&
> +		time_before_eq(fdb->ageing_timer + hold_time(br), jiffies));
>  }
>  

No.
Local addresses should never age.

The proper way to capture packet is to us AF_PACKET or tc actions.
-- 

  reply	other threads:[~2011-02-15 18:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09 18:17 mac addresses of local interfaces do not obey setageing 0 Veaceslav Falico
2011-02-09 18:17 ` [Bridge] " Veaceslav Falico
2011-02-15 18:25 ` Stephen Hemminger [this message]
2011-02-15 18:25   ` Stephen Hemminger
2011-02-17  9:56   ` David Lamparter
2011-02-17  9:56     ` [Bridge] " David Lamparter

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=20110215102538.5f24d62a@nehalam \
    --to=shemminger@vyatta.com \
    --cc=bridge@lists.linux-foundation.org \
    --cc=netdev@vger.kernel.org \
    --cc=vfalico@redhat.com \
    /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.