[v10,06/16] batman-adv: Provide TTVN in the mesh_info netlink msg

Message ID 1467545508-7333-7-git-send-email-sven@narfation.org (mailing list archive)
State Accepted, archived
Commit a754c023adfb91358e635005530a75ff04d345fa
Delegated to: Marek Lindner
Headers

Commit Message

Sven Eckelmann July 3, 2016, 11:31 a.m. UTC
  The TTVN is the main information for the debugging of translation table
problems. It is therefore necessary when comparing the global translation
tables.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/netlink.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Marek Lindner July 18, 2016, 2:06 a.m. UTC | #1
On Sunday, July 03, 2016 13:31:38 Sven Eckelmann wrote:
> The TTVN is the main information for the debugging of translation table
> problems. It is therefore necessary when comparing the global translation
> tables.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> ---
>  net/batman-adv/netlink.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Applied in revision a754c02.

Thanks,
Marek
  

Patch

diff --git a/net/batman-adv/netlink.c b/net/batman-adv/netlink.c
index 14360ec..0c0d20b 100644
--- a/net/batman-adv/netlink.c
+++ b/net/batman-adv/netlink.c
@@ -18,6 +18,7 @@ 
 #include "netlink.h"
 #include "main.h"
 
+#include <linux/atomic.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/genetlink.h>
@@ -121,7 +122,9 @@  batadv_netlink_mesh_info_put(struct sk_buff *msg, struct net_device *soft_iface)
 	    nla_put_u32(msg, BATADV_ATTR_MESH_IFINDEX, soft_iface->ifindex) ||
 	    nla_put_string(msg, BATADV_ATTR_MESH_IFNAME, soft_iface->name) ||
 	    nla_put(msg, BATADV_ATTR_MESH_ADDRESS, ETH_ALEN,
-		    soft_iface->dev_addr))
+		    soft_iface->dev_addr) ||
+	    nla_put_u8(msg, BATADV_ATTR_TT_TTVN,
+		       (u8)atomic_read(&bat_priv->tt.vn)))
 		goto out;
 
 	primary_if = batadv_primary_if_get_selected(bat_priv);