bridge: Simplify interface for ATM LANE
This patch changes FDB entry check for ATM LANE bridge integration. There's no point in holding a FDB entry around SKB building. br_fdb_get()/br_fdb_put() pair are changed into single br_fdb_test_addr() hook that checks if the addr has FDB entry pointing to other port to the one the request arrived on. FDB entry refcounting is removed as it's not used anywhere else. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
746e6ad23c
commit
da6782927d
@ -34,7 +34,6 @@
|
||||
|
||||
/* Proxy LEC knows about bridging */
|
||||
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
|
||||
#include <linux/if_bridge.h>
|
||||
#include "../bridge/br_private.h"
|
||||
|
||||
static unsigned char bridge_ula_lec[] = { 0x01, 0x80, 0xc2, 0x00, 0x00 };
|
||||
@ -518,18 +517,14 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
|
||||
case l_should_bridge:
|
||||
#if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
|
||||
{
|
||||
struct net_bridge_fdb_entry *f;
|
||||
|
||||
pr_debug("%s: bridge zeppelin asks about %pM\n",
|
||||
dev->name, mesg->content.proxy.mac_addr);
|
||||
|
||||
if (br_fdb_get_hook == NULL || dev->br_port == NULL)
|
||||
if (br_fdb_test_addr_hook == NULL)
|
||||
break;
|
||||
|
||||
f = br_fdb_get_hook(dev->br_port->br,
|
||||
mesg->content.proxy.mac_addr);
|
||||
if (f != NULL && f->dst->dev != dev
|
||||
&& f->dst->state == BR_STATE_FORWARDING) {
|
||||
if (br_fdb_test_addr_hook(dev,
|
||||
mesg->content.proxy.mac_addr)) {
|
||||
/* hit from bridge table, send LE_ARP_RESPONSE */
|
||||
struct sk_buff *skb2;
|
||||
struct sock *sk;
|
||||
@ -540,10 +535,8 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
|
||||
skb2 =
|
||||
alloc_skb(sizeof(struct atmlec_msg),
|
||||
GFP_ATOMIC);
|
||||
if (skb2 == NULL) {
|
||||
br_fdb_put_hook(f);
|
||||
if (skb2 == NULL)
|
||||
break;
|
||||
}
|
||||
skb2->len = sizeof(struct atmlec_msg);
|
||||
skb_copy_to_linear_data(skb2, mesg,
|
||||
sizeof(*mesg));
|
||||
@ -552,8 +545,6 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
|
||||
skb_queue_tail(&sk->sk_receive_queue, skb2);
|
||||
sk->sk_data_ready(sk, skb2->len);
|
||||
}
|
||||
if (f != NULL)
|
||||
br_fdb_put_hook(f);
|
||||
}
|
||||
#endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */
|
||||
break;
|
||||
|
Reference in New Issue
Block a user