aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bridge_loop_avoidance.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-11 02:31:37 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-11 02:31:37 -0400
commit941a46a29c9388f9cef518fa3498329fb55badca (patch)
tree548156dac0a7f8246310d5beb4cda3ecff14e67e /net/batman-adv/bridge_loop_avoidance.c
parent313b037cf054ec908de92fb4c085403ffd7420d4 (diff)
parent2d3f6ccc4ea5c74d4b4af1b47c56b4cff4bbfcb7 (diff)
Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge
Included changes: - fix a bug generated by the wrong interaction between the GW feature and the Bridge Loop Avoidance
Diffstat (limited to 'net/batman-adv/bridge_loop_avoidance.c')
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 8bf97515a77d..c5863f499133 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1351,6 +1351,7 @@ void bla_free(struct bat_priv *bat_priv)
1351 * @bat_priv: the bat priv with all the soft interface information 1351 * @bat_priv: the bat priv with all the soft interface information
1352 * @skb: the frame to be checked 1352 * @skb: the frame to be checked
1353 * @vid: the VLAN ID of the frame 1353 * @vid: the VLAN ID of the frame
1354 * @is_bcast: the packet came in a broadcast packet type.
1354 * 1355 *
1355 * bla_rx avoidance checks if: 1356 * bla_rx avoidance checks if:
1356 * * we have to race for a claim 1357 * * we have to race for a claim
@@ -1361,7 +1362,8 @@ void bla_free(struct bat_priv *bat_priv)
1361 * process the skb. 1362 * process the skb.
1362 * 1363 *
1363 */ 1364 */
1364int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid) 1365int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid,
1366 bool is_bcast)
1365{ 1367{
1366 struct ethhdr *ethhdr; 1368 struct ethhdr *ethhdr;
1367 struct claim search_claim, *claim = NULL; 1369 struct claim search_claim, *claim = NULL;
@@ -1380,7 +1382,7 @@ int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
1380 1382
1381 if (unlikely(atomic_read(&bat_priv->bla_num_requests))) 1383 if (unlikely(atomic_read(&bat_priv->bla_num_requests)))
1382 /* don't allow broadcasts while requests are in flight */ 1384 /* don't allow broadcasts while requests are in flight */
1383 if (is_multicast_ether_addr(ethhdr->h_dest)) 1385 if (is_multicast_ether_addr(ethhdr->h_dest) && is_bcast)
1384 goto handled; 1386 goto handled;
1385 1387
1386 memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN); 1388 memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN);
@@ -1406,8 +1408,13 @@ int bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
1406 } 1408 }
1407 1409
1408 /* if it is a broadcast ... */ 1410 /* if it is a broadcast ... */
1409 if (is_multicast_ether_addr(ethhdr->h_dest)) { 1411 if (is_multicast_ether_addr(ethhdr->h_dest) && is_bcast) {
1410 /* ... drop it. the responsible gateway is in charge. */ 1412 /* ... drop it. the responsible gateway is in charge.
1413 *
1414 * We need to check is_bcast because with the gateway
1415 * feature, broadcasts (like DHCP requests) may be sent
1416 * using a unicast packet type.
1417 */
1411 goto handled; 1418 goto handled;
1412 } else { 1419 } else {
1413 /* seems the client considers us as its best gateway. 1420 /* seems the client considers us as its best gateway.