diff options
author | Linus Lüssing <linus.luessing@web.de> | 2010-03-22 22:46:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 11:35:59 -0700 |
commit | f6497e38fda6970819daacb67725d67474079381 (patch) | |
tree | 1caa4f81012ec4d60458d1e245a500041cf23239 /drivers/staging/batman-adv/vis.c | |
parent | 107c32fe68f0b64acb7edd31d44d79b87c7fa8b4 (diff) | |
download | op-kernel-dev-f6497e38fda6970819daacb67725d67474079381.zip op-kernel-dev-f6497e38fda6970819daacb67725d67474079381.tar.gz |
Staging: batman-adv: Fix VIS output bug for secondary interfaces
TQ and HNA records for originators on secondary interfaces were
wrongly being included on the primary interface. Ensure we output a
line for each source interface on every node, so we correctly separate
primary and secondary interface records.
Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/vis.c')
-rw-r--r-- | drivers/staging/batman-adv/vis.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/staging/batman-adv/vis.c b/drivers/staging/batman-adv/vis.c index 0b5c63f..222db01 100644 --- a/drivers/staging/batman-adv/vis.c +++ b/drivers/staging/batman-adv/vis.c @@ -86,7 +86,7 @@ static int vis_info_choose(void *data, int size) /* insert interface to the list of interfaces of one originator, if it * does not already exist in the list */ -static void proc_vis_insert_interface(const uint8_t *interface, +void proc_vis_insert_interface(const uint8_t *interface, struct hlist_head *if_list, bool primary) { @@ -111,39 +111,32 @@ void proc_vis_read_prim_sec(struct seq_file *seq, struct hlist_head *if_list) { struct if_list_entry *entry; - struct hlist_node *pos, *n; + struct hlist_node *pos; char tmp_addr_str[ETH_STR_LEN]; - hlist_for_each_entry_safe(entry, pos, n, if_list, list) { - if (entry->primary) { + hlist_for_each_entry(entry, pos, if_list, list) { + if (entry->primary) seq_printf(seq, "PRIMARY, "); - } else { + else { addr_to_string(tmp_addr_str, entry->addr); seq_printf(seq, "SEC %s, ", tmp_addr_str); } - - hlist_del(&entry->list); - kfree(entry); } } /* read an entry */ void proc_vis_read_entry(struct seq_file *seq, struct vis_info_entry *entry, - struct hlist_head *if_list, - uint8_t *vis_orig) + uint8_t *src, + bool primary) { char to[40]; addr_to_string(to, entry->dest); - if (entry->quality == 0) { - proc_vis_insert_interface(vis_orig, if_list, true); + if (primary && entry->quality == 0) seq_printf(seq, "HNA %s, ", to); - } else { - proc_vis_insert_interface(entry->src, if_list, - compare_orig(entry->src, vis_orig)); + else if (compare_orig(entry->src, src)) seq_printf(seq, "TQ %s %d, ", to, entry->quality); - } } /* add the info packet to the send list, if it was not |