* [B.A.T.M.A.N.] [PATCH] alfred: vis: Fix direct neighbors detection with netlink query
@ 2016-09-23 14:00 Sven Eckelmann
2016-10-14 13:33 ` Simon Wunderlich
0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2016-09-23 14:00 UTC (permalink / raw)
To: b.a.t.m.a.n
Only entries in the originator table with the destination address equal to
the originator address should be handled by alfred as actual neighbors.
Fixes: bca55a86fecd ("alfred: vis: Add support for netlink")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
vis/vis.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/vis/vis.c b/vis/vis.c
index 94e583e..f4d13c7 100644
--- a/vis/vis.c
+++ b/vis/vis.c
@@ -453,6 +453,7 @@ err:
static const int parse_orig_list_mandatory[] = {
BATADV_ATTR_ORIG_ADDRESS,
+ BATADV_ATTR_NEIGH_ADDRESS,
BATADV_ATTR_TQ,
BATADV_ATTR_HARD_IFINDEX,
};
@@ -466,6 +467,7 @@ static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg)
struct genlmsghdr *ghdr;
struct vis_list_entry *v_entry;
uint8_t *orig;
+ uint8_t *neigh;
uint8_t tq;
uint32_t hardif;
@@ -493,12 +495,16 @@ static int parse_orig_list_netlink_cb(struct nl_msg *msg, void *arg)
return NL_OK;
orig = nla_data(attrs[BATADV_ATTR_ORIG_ADDRESS]);
+ neigh = nla_data(attrs[BATADV_ATTR_NEIGH_ADDRESS]);
tq = nla_get_u8(attrs[BATADV_ATTR_TQ]);
hardif = nla_get_u32(attrs[BATADV_ATTR_HARD_IFINDEX]);
if (tq < 1)
return NL_OK;
+ if (memcmp(orig, neigh, ETH_ALEN) != 0)
+ return NL_OK;
+
v_entry = malloc(sizeof(*v_entry));
if (!v_entry)
return NL_OK;
--
2.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] alfred: vis: Fix direct neighbors detection with netlink query
2016-09-23 14:00 [B.A.T.M.A.N.] [PATCH] alfred: vis: Fix direct neighbors detection with netlink query Sven Eckelmann
@ 2016-10-14 13:33 ` Simon Wunderlich
0 siblings, 0 replies; 2+ messages in thread
From: Simon Wunderlich @ 2016-10-14 13:33 UTC (permalink / raw)
To: b.a.t.m.a.n
[-- Attachment #1: Type: text/plain, Size: 386 bytes --]
On Friday, September 23, 2016 4:00:13 PM CEST Sven Eckelmann wrote:
> Only entries in the originator table with the destination address equal to
> the originator address should be handled by alfred as actual neighbors.
>
> Fixes: bca55a86fecd ("alfred: vis: Add support for netlink")
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Applied in revision a3fb7d0
Thanks!
Simon
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-14 13:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-23 14:00 [B.A.T.M.A.N.] [PATCH] alfred: vis: Fix direct neighbors detection with netlink query Sven Eckelmann
2016-10-14 13:33 ` Simon Wunderlich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).