[B.A.T.M.A.N.] [PATCH 1/8] batman-adv: move ogm initialization into the proper function

Marek Lindner
2012-02-07T09:19:58Z

Signed-of-by: Marek Lindner <lindner_marek@yahoo.de>
---
hard-interface.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/hard-interface.c b/hard-interface.c
index 612f2c8..e16c996 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -337,7 +337,6 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
hard_iface->batman_adv_ptype.dev = hard_iface->net_dev;
dev_add_pack(&hard_iface->batman_adv_ptype);

- atomic_set(&hard_iface->seqno, 1);
atomic_set(&hard_iface->frag_seqno, 1);
bat_info(hard_iface->soft_iface, "Adding interface: %s\n",
hard_iface->net_dev->name);
@@ -463,6 +462,13 @@ static struct hard_iface *hardif_add_interface(struct net_device *net_dev)
check_known_mac_addr(hard_iface->net_dev);
list_add_tail_rcu(&hard_iface->list, &hardif_list);

+ /**
+ * This can't be called via a bat_priv callback because
+ * we have no bat_priv yet.
+ */
+ atomic_set(&hard_iface->seqno, 1);
+ hard_iface->packet_buff = NULL;
+
return hard_iface;

free_if:
--
1.7.5.4