diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-06-15 02:50:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-15 14:48:58 -0400 |
commit | f350a0a87374418635689471606454abc7beaa3a (patch) | |
tree | c8210542a9848f6b5953b58d2ba1dbfb11715f14 /net/bridge/br_input.c | |
parent | a35e2c1b6d90544b3c688783869817628e5f9607 (diff) |
bridge: use rx_handler_data pointer to store net_bridge_port pointer
Register net_bridge_port pointer as rx_handler data pointer. As br_port is
removed from struct net_device, another netdev priv_flag is added to indicate
the device serves as a bridge port. Also rcuized pointers are now correctly
dereferenced in br_fdb.c and in netfilter parts.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_input.c')
-rw-r--r-- | net/bridge/br_input.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c index 99647d8f95c8..f076c9d79d5e 100644 --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c | |||
@@ -41,7 +41,7 @@ static int br_pass_frame_up(struct sk_buff *skb) | |||
41 | int br_handle_frame_finish(struct sk_buff *skb) | 41 | int br_handle_frame_finish(struct sk_buff *skb) |
42 | { | 42 | { |
43 | const unsigned char *dest = eth_hdr(skb)->h_dest; | 43 | const unsigned char *dest = eth_hdr(skb)->h_dest; |
44 | struct net_bridge_port *p = rcu_dereference(skb->dev->br_port); | 44 | struct net_bridge_port *p = br_port_get_rcu(skb->dev); |
45 | struct net_bridge *br; | 45 | struct net_bridge *br; |
46 | struct net_bridge_fdb_entry *dst; | 46 | struct net_bridge_fdb_entry *dst; |
47 | struct net_bridge_mdb_entry *mdst; | 47 | struct net_bridge_mdb_entry *mdst; |
@@ -111,10 +111,9 @@ drop: | |||
111 | /* note: already called with rcu_read_lock (preempt_disabled) */ | 111 | /* note: already called with rcu_read_lock (preempt_disabled) */ |
112 | static int br_handle_local_finish(struct sk_buff *skb) | 112 | static int br_handle_local_finish(struct sk_buff *skb) |
113 | { | 113 | { |
114 | struct net_bridge_port *p = rcu_dereference(skb->dev->br_port); | 114 | struct net_bridge_port *p = br_port_get_rcu(skb->dev); |
115 | 115 | ||
116 | if (p) | 116 | br_fdb_update(p->br, p, eth_hdr(skb)->h_source); |
117 | br_fdb_update(p->br, p, eth_hdr(skb)->h_source); | ||
118 | return 0; /* process further */ | 117 | return 0; /* process further */ |
119 | } | 118 | } |
120 | 119 | ||
@@ -151,7 +150,7 @@ struct sk_buff *br_handle_frame(struct sk_buff *skb) | |||
151 | if (!skb) | 150 | if (!skb) |
152 | return NULL; | 151 | return NULL; |
153 | 152 | ||
154 | p = rcu_dereference(skb->dev->br_port); | 153 | p = br_port_get_rcu(skb->dev); |
155 | 154 | ||
156 | if (unlikely(is_link_local(dest))) { | 155 | if (unlikely(is_link_local(dest))) { |
157 | /* Pause frames shouldn't be passed up by driver anyway */ | 156 | /* Pause frames shouldn't be passed up by driver anyway */ |