diff options
author | Antonio Quartulli <antonio@open-mesh.com> | 2013-08-07 12:28:55 -0400 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2013-10-19 17:25:37 -0400 |
commit | 95fb130d68656174a417ad19e7bc8e8ecf382dab (patch) | |
tree | a3088a8c8217330e4d9fc84413ff9fa24a4debaf /net/batman-adv/translation-table.c | |
parent | 7ea7b4a142758deaf46c1af0ca9ceca6dd55138b (diff) |
batman-adv: make the TT global purge routine VLAN specific
Instead of unconditionally removing all the TT entries
served by a given originator, make tt_global_orig_del()
remove only entries matching a given VLAN identifier
provided as argument.
If such argument is negative all the global entries
served by the originator are removed.
This change is used into the BLA code to purge entries
served by a newly discovered Backbone node, but limiting
the operation only to those connected to the VLAN where the
backbone has been discovered.
Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/translation-table.c')
-rw-r--r-- | net/batman-adv/translation-table.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 41a8387c5ef8..4c313ff8b12f 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -1581,8 +1581,18 @@ out: | |||
1581 | batadv_tt_local_entry_free_ref(local_entry); | 1581 | batadv_tt_local_entry_free_ref(local_entry); |
1582 | } | 1582 | } |
1583 | 1583 | ||
1584 | /** | ||
1585 | * batadv_tt_global_del_orig - remove all the TT global entries belonging to the | ||
1586 | * given originator matching the provided vid | ||
1587 | * @bat_priv: the bat priv with all the soft interface information | ||
1588 | * @orig_node: the originator owning the entries to remove | ||
1589 | * @match_vid: the VLAN identifier to match. If negative all the entries will be | ||
1590 | * removed | ||
1591 | * @message: debug message to print as "reason" | ||
1592 | */ | ||
1584 | void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, | 1593 | void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, |
1585 | struct batadv_orig_node *orig_node, | 1594 | struct batadv_orig_node *orig_node, |
1595 | int32_t match_vid, | ||
1586 | const char *message) | 1596 | const char *message) |
1587 | { | 1597 | { |
1588 | struct batadv_tt_global_entry *tt_global; | 1598 | struct batadv_tt_global_entry *tt_global; |
@@ -1604,6 +1614,10 @@ void batadv_tt_global_del_orig(struct batadv_priv *bat_priv, | |||
1604 | spin_lock_bh(list_lock); | 1614 | spin_lock_bh(list_lock); |
1605 | hlist_for_each_entry_safe(tt_common_entry, safe, | 1615 | hlist_for_each_entry_safe(tt_common_entry, safe, |
1606 | head, hash_entry) { | 1616 | head, hash_entry) { |
1617 | /* remove only matching entries */ | ||
1618 | if (match_vid >= 0 && tt_common_entry->vid != match_vid) | ||
1619 | continue; | ||
1620 | |||
1607 | tt_global = container_of(tt_common_entry, | 1621 | tt_global = container_of(tt_common_entry, |
1608 | struct batadv_tt_global_entry, | 1622 | struct batadv_tt_global_entry, |
1609 | common); | 1623 | common); |
@@ -2570,7 +2584,8 @@ static void batadv_tt_fill_gtable(struct batadv_priv *bat_priv, | |||
2570 | goto out; | 2584 | goto out; |
2571 | 2585 | ||
2572 | /* Purge the old table first.. */ | 2586 | /* Purge the old table first.. */ |
2573 | batadv_tt_global_del_orig(bat_priv, orig_node, "Received full table"); | 2587 | batadv_tt_global_del_orig(bat_priv, orig_node, -1, |
2588 | "Received full table"); | ||
2574 | 2589 | ||
2575 | _batadv_tt_update_changes(bat_priv, orig_node, tt_change, num_entries, | 2590 | _batadv_tt_update_changes(bat_priv, orig_node, tt_change, num_entries, |
2576 | ttvn); | 2591 | ttvn); |