Skip to content

Commit 9323158

Browse files
committed
batman-adv: OGMv2 - implement originators logic
Add the support for recognising new originators in the network and rebroadcast their OGMs. Signed-off-by: Antonio Quartulli <[email protected]> Signed-off-by: Marek Lindner <[email protected]>
1 parent 0da0035 commit 9323158

File tree

5 files changed

+566
-41
lines changed

5 files changed

+566
-41
lines changed

net/batman-adv/bat_v_elp.c

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
#include <linux/workqueue.h>
3838

3939
#include "bat_algo.h"
40+
#include "bat_v_ogm.h"
4041
#include "hard-interface.h"
41-
#include "hash.h"
4242
#include "originator.h"
4343
#include "packet.h"
4444
#include "routing.h"
@@ -195,45 +195,6 @@ void batadv_v_elp_primary_iface_set(struct batadv_hard_iface *primary_iface)
195195
rcu_read_unlock();
196196
}
197197

198-
/**
199-
* batadv_v_ogm_orig_get - retrieve and possibly create an originator node
200-
* @bat_priv: the bat priv with all the soft interface information
201-
* @addr: the address of the originator
202-
*
203-
* Return: the orig_node corresponding to the specified address. If such object
204-
* does not exist it is allocated here. In case of allocation failure returns
205-
* NULL.
206-
*/
207-
static struct batadv_orig_node *
208-
batadv_v_ogm_orig_get(struct batadv_priv *bat_priv,
209-
const u8 *addr)
210-
{
211-
struct batadv_orig_node *orig_node;
212-
int hash_added;
213-
214-
orig_node = batadv_orig_hash_find(bat_priv, addr);
215-
if (orig_node)
216-
return orig_node;
217-
218-
orig_node = batadv_orig_node_new(bat_priv, addr);
219-
if (!orig_node)
220-
return NULL;
221-
222-
hash_added = batadv_hash_add(bat_priv->orig_hash, batadv_compare_orig,
223-
batadv_choose_orig, orig_node,
224-
&orig_node->hash_entry);
225-
if (hash_added != 0) {
226-
/* orig_node->refcounter is initialised to 2 by
227-
* batadv_orig_node_new()
228-
*/
229-
batadv_orig_node_put(orig_node);
230-
batadv_orig_node_put(orig_node);
231-
orig_node = NULL;
232-
}
233-
234-
return orig_node;
235-
}
236-
237198
/**
238199
* batadv_v_elp_neigh_update - update an ELP neighbour node
239200
* @bat_priv: the bat priv with all the soft interface information

0 commit comments

Comments
 (0)