batman-adv: Distributed ARP Table - implement local storage

Since batman-adv cannot inter-operate with the host ARP table, this patch
introduces a batman-adv private storage for ARP entries exchanged within DAT.
This storage will represent the node local cache in the DAT protocol.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
This commit is contained in:
Antonio Quartulli
2012-06-30 20:01:19 +02:00
parent 785ea11441
commit 2f1dfbe185
6 changed files with 346 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
#include "hard-interface.h"
#include "gateway_client.h"
#include "bridge_loop_avoidance.h"
#include "distributed-arp-table.h"
#include "vis.h"
#include "hash.h"
#include "bat_algo.h"
@@ -128,6 +129,10 @@ int batadv_mesh_init(struct net_device *soft_iface)
if (ret < 0)
goto err;
ret = batadv_dat_init(bat_priv);
if (ret < 0)
goto err;
atomic_set(&bat_priv->gw.reselect, 0);
atomic_set(&bat_priv->mesh_state, BATADV_MESH_ACTIVE);
@@ -155,6 +160,8 @@ void batadv_mesh_free(struct net_device *soft_iface)
batadv_bla_free(bat_priv);
batadv_dat_free(bat_priv);
free_percpu(bat_priv->bat_counters);
atomic_set(&bat_priv->mesh_state, BATADV_MESH_INACTIVE);