Project

General

Profile

Bug #164 » batman-adv_002_fix_softiface_mac_update_remove_old_tt_entry.patch

Def D, 09/06/2012 12:03 PM

View differences:

soft-interface.c.ORG2 2012-09-06 10:27:07.030979369 +0200 → soft-interface.c 2012-09-06 10:30:46.000000000 +0200
107 107
	/* only modify transtable if it has been initialized before */
108 108
	if (atomic_read(&bat_priv->mesh_state) == BATADV_MESH_ACTIVE) {
109 109
		batadv_tt_local_remove(bat_priv, dev->dev_addr,
110
				       "mac address changed", false);
110
				       "mac address changed", false, true);
111 111
		memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
112 112
		batadv_tt_local_add(dev, addr->sa_data, BATADV_NULL_IFINDEX);
113 113
	}else{
114
-- a/translation-table.c.ORG	2012-09-06 10:27:23.127055983 +0200
114
++ b/translation-table.c	2012-09-06 10:30:24.000000000 +0200
......
495 495
}
496 496

  
497 497
void batadv_tt_local_remove(struct batadv_priv *bat_priv, const uint8_t *addr,
498
			    const char *message, bool roaming)
498
			    const char *message, bool roaming, bool force)
499 499
{
500 500
	struct batadv_tt_local_entry *tt_local_entry = NULL;
501 501
	uint16_t flags;
......
508 508
	if (roaming)
509 509
		flags |= BATADV_TT_CLIENT_ROAM;
510 510

  
511
	if(force)
512
		tt_local_entry->common.flags &= ~BATADV_TT_CLIENT_NOPURGE;
513

  
511 514
	batadv_tt_local_set_pending(bat_priv, tt_local_entry, flags, message);
512 515
out:
513 516
	if (tt_local_entry)
......
742 745
	/* remove address from local hash if present */
743 746
	batadv_tt_local_remove(bat_priv, tt_global_entry->common.addr,
744 747
			       "global tt received",
745
			       flags & BATADV_TT_CLIENT_ROAM);
748
			       flags & BATADV_TT_CLIENT_ROAM, false);
746 749
	ret = 1;
747 750
out:
748 751
	if (tt_global_entry)
749
-- a/translation-table.h.ORG	2012-09-06 10:26:54.910921682 +0200
752
++ b/translation-table.h	2012-09-06 10:29:26.000000000 +0200
......
26 26
			 int ifindex);
27 27
void batadv_tt_local_remove(struct batadv_priv *bat_priv,
28 28
			    const uint8_t *addr, const char *message,
29
			    bool roaming);
29
			    bool roaming, bool force);
30 30
int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset);
31 31
void batadv_tt_global_add_orig(struct batadv_priv *bat_priv,
32 32
			       struct batadv_orig_node *orig_node,
(2-2/3)