diff options
author | Antonio Quartulli <ordex@autistici.org> | 2011-07-07 09:35:36 -0400 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2011-08-22 09:16:20 -0400 |
commit | 59b699cdee039d75915c354da06937102d1f9a84 (patch) | |
tree | 33fabd9cac27cb7bc1d3fbc765f098b5b8e8575e /net/batman-adv/soft-interface.c | |
parent | bc2790808a7a3699a7c9f72f7ad225c8504824aa (diff) |
batman-adv: implement AP-isolation on the receiver side
When a node receives a unicast packet it checks if the source and the
destination client can communicate or not due to the AP isolation
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/soft-interface.c')
-rw-r--r-- | net/batman-adv/soft-interface.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c index 6deed44a3703..9addbab52999 100644 --- a/net/batman-adv/soft-interface.c +++ b/net/batman-adv/soft-interface.c | |||
@@ -739,6 +739,9 @@ void interface_rx(struct net_device *soft_iface, | |||
739 | 739 | ||
740 | soft_iface->last_rx = jiffies; | 740 | soft_iface->last_rx = jiffies; |
741 | 741 | ||
742 | if (is_ap_isolated(bat_priv, ethhdr->h_source, ethhdr->h_dest)) | ||
743 | goto dropped; | ||
744 | |||
742 | netif_rx(skb); | 745 | netif_rx(skb); |
743 | goto out; | 746 | goto out; |
744 | 747 | ||
@@ -812,6 +815,7 @@ struct net_device *softif_create(const char *name) | |||
812 | 815 | ||
813 | atomic_set(&bat_priv->aggregated_ogms, 1); | 816 | atomic_set(&bat_priv->aggregated_ogms, 1); |
814 | atomic_set(&bat_priv->bonding, 0); | 817 | atomic_set(&bat_priv->bonding, 0); |
818 | atomic_set(&bat_priv->ap_isolation, 0); | ||
815 | atomic_set(&bat_priv->vis_mode, VIS_TYPE_CLIENT_UPDATE); | 819 | atomic_set(&bat_priv->vis_mode, VIS_TYPE_CLIENT_UPDATE); |
816 | atomic_set(&bat_priv->gw_mode, GW_MODE_OFF); | 820 | atomic_set(&bat_priv->gw_mode, GW_MODE_OFF); |
817 | atomic_set(&bat_priv->gw_sel_class, 20); | 821 | atomic_set(&bat_priv->gw_sel_class, 20); |