[Bridge] [PATCH net-next 5/8] bridge: Add addresses from static fdbs to non-promisc ports

Sergei Shtylyov sergei.shtylyov at cogentembedded.com
Wed May 14 20:44:51 UTC 2014


On 05/14/2014 07:09 PM, Vlad Yasevich wrote:

> When a static fdb entry is created, add the mac address
> from this fdb entry to any ports that are currently running
> in non-promiscuous mode.  These ports need this data so that
> they can receive traffic destined to these addresses.
> By default ports start in promiscuous mode, so this feature
> is disabled.

> Signed-off-by: Vlad Yasevich <vyasevic at redhat.com>
> ---
>   net/bridge/br_fdb.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++-----
>   1 file changed, 70 insertions(+), 6 deletions(-)

> diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
> index 9759b61..958b68a 100644
> --- a/net/bridge/br_fdb.c
> +++ b/net/bridge/br_fdb.c
> @@ -85,8 +85,58 @@ static void fdb_rcu_free(struct rcu_head *head)
>   	kmem_cache_free(br_fdb_cache, ent);
>   }
>
> +/* When a static FDB entry is added, the mac address from the entry is
> + * added to the bridge private HW address list and all required ports
> + * are then updated with the new information.
> + * Called under RTNL.
> + */
> +static void fdb_add_hw(struct net_bridge *br, const unsigned char *addr)
> +{
> +	int err;
> +	struct net_bridge_port *p, *tmp = NULL;

    Initializer doesn't seem to be needed.

[...]

WBR, Sergei



More information about the Bridge mailing list