aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-11 02:56:33 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-11 02:56:33 -0400
commit04c9f416e371cff076a8b3279fb213628915d059 (patch)
tree2b64cb835cbc9d19d2d06f1e7618615d40ada0af /net/batman-adv
parentc278fa53c123282f753b2264fc62c0e9502a32fa (diff)
parentc1f5163de417dab01fa9daaf09a74bbb19303f3c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: net/batman-adv/bridge_loop_avoidance.c net/batman-adv/bridge_loop_avoidance.h net/batman-adv/soft-interface.c net/mac80211/mlme.c With merge help from Antonio Quartulli (batman-adv) and Stephen Rothwell (drivers/net/usb/qmi_wwan.c). The net/mac80211/mlme.c conflict seemed easy enough, accounting for a conversion to some new tracing macros. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c15
-rw-r--r--net/batman-adv/bridge_loop_avoidance.h6
-rw-r--r--net/batman-adv/soft-interface.c6
3 files changed, 20 insertions, 7 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 3483e4035cb..6705d35b17c 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1381,6 +1381,7 @@ void batadv_bla_free(struct batadv_priv *bat_priv)
1381 * @bat_priv: the bat priv with all the soft interface information 1381 * @bat_priv: the bat priv with all the soft interface information
1382 * @skb: the frame to be checked 1382 * @skb: the frame to be checked
1383 * @vid: the VLAN ID of the frame 1383 * @vid: the VLAN ID of the frame
1384 * @is_bcast: the packet came in a broadcast packet type.
1384 * 1385 *
1385 * bla_rx avoidance checks if: 1386 * bla_rx avoidance checks if:
1386 * * we have to race for a claim 1387 * * we have to race for a claim
@@ -1390,7 +1391,8 @@ void batadv_bla_free(struct batadv_priv *bat_priv)
1390 * returns 1, otherwise it returns 0 and the caller shall further 1391 * returns 1, otherwise it returns 0 and the caller shall further
1391 * process the skb. 1392 * process the skb.
1392 */ 1393 */
1393int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid) 1394int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid,
1395 bool is_bcast)
1394{ 1396{
1395 struct ethhdr *ethhdr; 1397 struct ethhdr *ethhdr;
1396 struct batadv_claim search_claim, *claim = NULL; 1398 struct batadv_claim search_claim, *claim = NULL;
@@ -1409,7 +1411,7 @@ int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid)
1409 1411
1410 if (unlikely(atomic_read(&bat_priv->bla_num_requests))) 1412 if (unlikely(atomic_read(&bat_priv->bla_num_requests)))
1411 /* don't allow broadcasts while requests are in flight */ 1413 /* don't allow broadcasts while requests are in flight */
1412 if (is_multicast_ether_addr(ethhdr->h_dest)) 1414 if (is_multicast_ether_addr(ethhdr->h_dest) && is_bcast)
1413 goto handled; 1415 goto handled;
1414 1416
1415 memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN); 1417 memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN);
@@ -1435,8 +1437,13 @@ int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid)
1435 } 1437 }
1436 1438
1437 /* if it is a broadcast ... */ 1439 /* if it is a broadcast ... */
1438 if (is_multicast_ether_addr(ethhdr->h_dest)) { 1440 if (is_multicast_ether_addr(ethhdr->h_dest) && is_bcast) {
1439 /* ... drop it. the responsible gateway is in charge. */ 1441 /* ... drop it. the responsible gateway is in charge.
1442 *
1443 * We need to check is_bcast because with the gateway
1444 * feature, broadcasts (like DHCP requests) may be sent
1445 * using a unicast packet type.
1446 */
1440 goto handled; 1447 goto handled;
1441 } else { 1448 } else {
1442 /* seems the client considers us as its best gateway. 1449 /* seems the client considers us as its best gateway.
diff --git a/net/batman-adv/bridge_loop_avoidance.h b/net/batman-adv/bridge_loop_avoidance.h
index 08d13cb1e3d..563cfbf94a7 100644
--- a/net/batman-adv/bridge_loop_avoidance.h
+++ b/net/batman-adv/bridge_loop_avoidance.h
@@ -21,7 +21,8 @@
21#define _NET_BATMAN_ADV_BLA_H_ 21#define _NET_BATMAN_ADV_BLA_H_
22 22
23#ifdef CONFIG_BATMAN_ADV_BLA 23#ifdef CONFIG_BATMAN_ADV_BLA
24int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid); 24int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid,
25 bool is_bcast);
25int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid); 26int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid);
26int batadv_bla_is_backbone_gw(struct sk_buff *skb, 27int batadv_bla_is_backbone_gw(struct sk_buff *skb,
27 struct batadv_orig_node *orig_node, int hdr_size); 28 struct batadv_orig_node *orig_node, int hdr_size);
@@ -40,7 +41,8 @@ void batadv_bla_free(struct batadv_priv *bat_priv);
40#else /* ifdef CONFIG_BATMAN_ADV_BLA */ 41#else /* ifdef CONFIG_BATMAN_ADV_BLA */
41 42
42static inline int batadv_bla_rx(struct batadv_priv *bat_priv, 43static inline int batadv_bla_rx(struct batadv_priv *bat_priv,
43 struct sk_buff *skb, short vid) 44 struct sk_buff *skb, short vid,
45 bool is_bcast)
44{ 46{
45 return 0; 47 return 0;
46} 48}
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 9e4bb61301e..109ea2aae96 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -267,8 +267,12 @@ void batadv_interface_rx(struct net_device *soft_iface,
267 struct batadv_priv *bat_priv = netdev_priv(soft_iface); 267 struct batadv_priv *bat_priv = netdev_priv(soft_iface);
268 struct ethhdr *ethhdr; 268 struct ethhdr *ethhdr;
269 struct vlan_ethhdr *vhdr; 269 struct vlan_ethhdr *vhdr;
270 struct batadv_header *batadv_header = (struct batadv_header *)skb->data;
270 short vid __maybe_unused = -1; 271 short vid __maybe_unused = -1;
271 __be16 ethertype = __constant_htons(BATADV_ETH_P_BATMAN); 272 __be16 ethertype = __constant_htons(BATADV_ETH_P_BATMAN);
273 bool is_bcast;
274
275 is_bcast = (batadv_header->packet_type == BATADV_BCAST);
272 276
273 /* check if enough space is available for pulling, and pull */ 277 /* check if enough space is available for pulling, and pull */
274 if (!pskb_may_pull(skb, hdr_size)) 278 if (!pskb_may_pull(skb, hdr_size))
@@ -315,7 +319,7 @@ void batadv_interface_rx(struct net_device *soft_iface,
315 /* Let the bridge loop avoidance check the packet. If will 319 /* Let the bridge loop avoidance check the packet. If will
316 * not handle it, we can safely push it up. 320 * not handle it, we can safely push it up.
317 */ 321 */
318 if (batadv_bla_rx(bat_priv, skb, vid)) 322 if (batadv_bla_rx(bat_priv, skb, vid, is_bcast))
319 goto out; 323 goto out;
320 324
321 netif_rx(skb); 325 netif_rx(skb);