Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340703
b: refs/heads/master
c: 33af49a
h: refs/heads/master
i:
  340701: 3574b83
  340699: cb9391a
  340695: 1e3d81c
  340687: 31b4876
  340671: 408b7b5
v: v3
  • Loading branch information
Antonio Quartulli committed Nov 7, 2012
1 parent f1d5f50 commit 480469b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 172244748204c894864def59133d0133ccfabe30
refs/heads/master: 33af49ad8ae44de52c0ac30b1a9707dad5e4c418
18 changes: 18 additions & 0 deletions trunk/net/batman-adv/distributed-arp-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,9 @@ static bool batadv_dat_send_data(struct batadv_priv *bat_priv,
*/
static void batadv_dat_hash_free(struct batadv_priv *bat_priv)
{
if (!bat_priv->dat.hash)
return;

__batadv_dat_purge(bat_priv, NULL);

batadv_hash_destroy(bat_priv->dat.hash);
Expand Down Expand Up @@ -790,6 +793,9 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
struct sk_buff *skb_new;
struct batadv_hard_iface *primary_if = NULL;

if (!atomic_read(&bat_priv->distributed_arp_table))
goto out;

type = batadv_arp_get_type(bat_priv, skb, 0);
/* If the node gets an ARP_REQUEST it has to send a DHT_GET unicast
* message to the selected DHT candidates
Expand Down Expand Up @@ -861,6 +867,9 @@ bool batadv_dat_snoop_incoming_arp_request(struct batadv_priv *bat_priv,
bool ret = false;
int err;

if (!atomic_read(&bat_priv->distributed_arp_table))
goto out;

type = batadv_arp_get_type(bat_priv, skb, hdr_size);
if (type != ARPOP_REQUEST)
goto out;
Expand Down Expand Up @@ -924,6 +933,9 @@ void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
__be32 ip_src, ip_dst;
uint8_t *hw_src, *hw_dst;

if (!atomic_read(&bat_priv->distributed_arp_table))
return;

type = batadv_arp_get_type(bat_priv, skb, 0);
if (type != ARPOP_REPLY)
return;
Expand Down Expand Up @@ -959,6 +971,9 @@ bool batadv_dat_snoop_incoming_arp_reply(struct batadv_priv *bat_priv,
uint8_t *hw_src, *hw_dst;
bool ret = false;

if (!atomic_read(&bat_priv->distributed_arp_table))
goto out;

type = batadv_arp_get_type(bat_priv, skb, hdr_size);
if (type != ARPOP_REPLY)
goto out;
Expand Down Expand Up @@ -1003,6 +1018,9 @@ bool batadv_dat_drop_broadcast_packet(struct batadv_priv *bat_priv,
bool ret = false;
const size_t bcast_len = sizeof(struct batadv_bcast_packet);

if (!atomic_read(&bat_priv->distributed_arp_table))
goto out;

/* If this packet is an ARP_REQUEST and the node already has the
* information that it is going to ask, then the packet can be dropped
*/
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/batman-adv/soft-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,9 @@ struct net_device *batadv_softif_create(const char *name)
atomic_set(&bat_priv->aggregated_ogms, 1);
atomic_set(&bat_priv->bonding, 0);
atomic_set(&bat_priv->bridge_loop_avoidance, 0);
#ifdef CONFIG_BATMAN_ADV_DAT
atomic_set(&bat_priv->distributed_arp_table, 1);
#endif
atomic_set(&bat_priv->ap_isolation, 0);
atomic_set(&bat_priv->vis_mode, BATADV_VIS_TYPE_CLIENT_UPDATE);
atomic_set(&bat_priv->gw_mode, BATADV_GW_MODE_OFF);
Expand Down
7 changes: 7 additions & 0 deletions trunk/net/batman-adv/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "main.h"
#include "sysfs.h"
#include "translation-table.h"
#include "distributed-arp-table.h"
#include "originator.h"
#include "hard-interface.h"
#include "gateway_common.h"
Expand Down Expand Up @@ -420,6 +421,9 @@ BATADV_ATTR_SIF_BOOL(bonding, S_IRUGO | S_IWUSR, NULL);
#ifdef CONFIG_BATMAN_ADV_BLA
BATADV_ATTR_SIF_BOOL(bridge_loop_avoidance, S_IRUGO | S_IWUSR, NULL);
#endif
#ifdef CONFIG_BATMAN_ADV_DAT
BATADV_ATTR_SIF_BOOL(distributed_arp_table, S_IRUGO | S_IWUSR, NULL);
#endif
BATADV_ATTR_SIF_BOOL(fragmentation, S_IRUGO | S_IWUSR, batadv_update_min_mtu);
BATADV_ATTR_SIF_BOOL(ap_isolation, S_IRUGO | S_IWUSR, NULL);
static BATADV_ATTR(vis_mode, S_IRUGO | S_IWUSR, batadv_show_vis_mode,
Expand All @@ -444,6 +448,9 @@ static struct batadv_attribute *batadv_mesh_attrs[] = {
&batadv_attr_bonding,
#ifdef CONFIG_BATMAN_ADV_BLA
&batadv_attr_bridge_loop_avoidance,
#endif
#ifdef CONFIG_BATMAN_ADV_DAT
&batadv_attr_distributed_arp_table,
#endif
&batadv_attr_fragmentation,
&batadv_attr_ap_isolation,
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/batman-adv/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ struct batadv_priv {
atomic_t fragmentation; /* boolean */
atomic_t ap_isolation; /* boolean */
atomic_t bridge_loop_avoidance; /* boolean */
#ifdef CONFIG_BATMAN_ADV_DAT
atomic_t distributed_arp_table; /* boolean */
#endif
atomic_t vis_mode; /* VIS_TYPE_* */
atomic_t gw_mode; /* GW_MODE_* */
atomic_t gw_sel_class; /* uint */
Expand Down

0 comments on commit 480469b

Please sign in to comment.