Commit beeb96a4 authored by Matthias Schiffer's avatar Matthias Schiffer Committed by Antonio Quartulli

batman-adv: fix visualization output without neighbors on the primary interface

The primary entry and the corresponding secondary entries are missing when there
are no neighbors on the primary interface. This also causes the TT entries to
miss and makes nodes with multiply secondary interface fall apart since there
is no way to see they are related without a primary entry.

Fix this by always emitting a primary entry.
Signed-off-by: default avatarMatthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
parent 16a70345
...@@ -207,7 +207,6 @@ int vis_seq_print_text(struct seq_file *seq, void *offset) ...@@ -207,7 +207,6 @@ int vis_seq_print_text(struct seq_file *seq, void *offset)
int vis_server = atomic_read(&bat_priv->vis_mode); int vis_server = atomic_read(&bat_priv->vis_mode);
size_t buff_pos, buf_size; size_t buff_pos, buf_size;
char *buff; char *buff;
int compare;
primary_if = primary_if_get_selected(bat_priv); primary_if = primary_if_get_selected(bat_priv);
if (!primary_if) if (!primary_if)
...@@ -228,14 +227,18 @@ int vis_seq_print_text(struct seq_file *seq, void *offset) ...@@ -228,14 +227,18 @@ int vis_seq_print_text(struct seq_file *seq, void *offset)
entries = (struct vis_info_entry *) entries = (struct vis_info_entry *)
((char *)packet + sizeof(*packet)); ((char *)packet + sizeof(*packet));
vis_data_insert_interface(packet->vis_orig,
&vis_if_list, true);
for (j = 0; j < packet->entries; j++) { for (j = 0; j < packet->entries; j++) {
if (entries[j].quality == 0) if (entries[j].quality == 0)
continue; continue;
compare = if (compare_eth(entries[j].src,
compare_eth(entries[j].src, packet->vis_orig); packet->vis_orig))
continue;
vis_data_insert_interface(entries[j].src, vis_data_insert_interface(entries[j].src,
&vis_if_list, &vis_if_list,
compare); false);
} }
hlist_for_each_entry(entry, pos, &vis_if_list, list) { hlist_for_each_entry(entry, pos, &vis_if_list, list) {
...@@ -276,14 +279,18 @@ int vis_seq_print_text(struct seq_file *seq, void *offset) ...@@ -276,14 +279,18 @@ int vis_seq_print_text(struct seq_file *seq, void *offset)
entries = (struct vis_info_entry *) entries = (struct vis_info_entry *)
((char *)packet + sizeof(*packet)); ((char *)packet + sizeof(*packet));
vis_data_insert_interface(packet->vis_orig,
&vis_if_list, true);
for (j = 0; j < packet->entries; j++) { for (j = 0; j < packet->entries; j++) {
if (entries[j].quality == 0) if (entries[j].quality == 0)
continue; continue;
compare = if (compare_eth(entries[j].src,
compare_eth(entries[j].src, packet->vis_orig); packet->vis_orig))
continue;
vis_data_insert_interface(entries[j].src, vis_data_insert_interface(entries[j].src,
&vis_if_list, &vis_if_list,
compare); false);
} }
hlist_for_each_entry(entry, pos, &vis_if_list, list) { hlist_for_each_entry(entry, pos, &vis_if_list, list) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment