summaryrefslogtreecommitdiffstats
path: root/drivers/staging/batman-adv/soft-interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/batman-adv/soft-interface.c')
-rw-r--r--drivers/staging/batman-adv/soft-interface.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/staging/batman-adv/soft-interface.c b/drivers/staging/batman-adv/soft-interface.c
index 64eaf2a..9b968df 100644
--- a/drivers/staging/batman-adv/soft-interface.c
+++ b/drivers/staging/batman-adv/soft-interface.c
@@ -29,6 +29,7 @@
#include "types.h"
#include "hash.h"
#include "gateway_common.h"
+#include "gateway_client.h"
#include "send.h"
#include "bat_sysfs.h"
#include <linux/slab.h>
@@ -346,6 +347,7 @@ int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
struct vlan_ethhdr *vhdr;
int data_len = skb->len, ret;
short vid = -1;
+ bool do_bcast = false;
if (atomic_read(&bat_priv->mesh_state) != MESH_ACTIVE)
goto dropped;
@@ -376,8 +378,18 @@ int interface_tx(struct sk_buff *skb, struct net_device *soft_iface)
/* TODO: check this for locks */
hna_local_add(soft_iface, ethhdr->h_source);
- /* ethernet packet should be broadcasted */
if (is_bcast(ethhdr->h_dest) || is_mcast(ethhdr->h_dest)) {
+ ret = gw_is_target(bat_priv, skb);
+
+ if (ret < 0)
+ goto dropped;
+
+ if (ret == 0)
+ do_bcast = true;
+ }
+
+ /* ethernet packet should be broadcasted */
+ if (do_bcast) {
if (!bat_priv->primary_if)
goto dropped;
OpenPOWER on IntegriCloud