diff options
author | Antonio Quartulli <ordex@autistici.org> | 2012-11-19 03:01:44 -0500 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2013-01-12 05:58:20 -0500 |
commit | 8425ec6aea20f8c8e1783d7390f5ea6ca01c58e1 (patch) | |
tree | c8de6412cca54314c6c9ed17553a621b492c4a12 /net/batman-adv/translation-table.c | |
parent | 39a329915889a220b5f2c3f2eb3d7fd892567715 (diff) |
batman-adv: remove useless assignment in tt_local_add()
The flag field of the tt_local_entry->common structure in
tt_local_add() is first assigned NO_FLAGS and then TT_CLIENT_NEW so
nullifying the first operation. For this reason it is safe to remove
the first assignment.
This was introuduced by ("batman-adv: keep local table consistency for
further TT_RESPONSE")
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
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 | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 40ef9557288a..5f442328f2e6 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -305,7 +305,11 @@ void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr, | |||
305 | (uint8_t)atomic_read(&bat_priv->tt.vn)); | 305 | (uint8_t)atomic_read(&bat_priv->tt.vn)); |
306 | 306 | ||
307 | memcpy(tt_local->common.addr, addr, ETH_ALEN); | 307 | memcpy(tt_local->common.addr, addr, ETH_ALEN); |
308 | tt_local->common.flags = BATADV_NO_FLAGS; | 308 | /* The local entry has to be marked as NEW to avoid to send it in |
309 | * a full table response going out before the next ttvn increment | ||
310 | * (consistency check) | ||
311 | */ | ||
312 | tt_local->common.flags = BATADV_TT_CLIENT_NEW; | ||
309 | if (batadv_is_wifi_iface(ifindex)) | 313 | if (batadv_is_wifi_iface(ifindex)) |
310 | tt_local->common.flags |= BATADV_TT_CLIENT_WIFI; | 314 | tt_local->common.flags |= BATADV_TT_CLIENT_WIFI; |
311 | atomic_set(&tt_local->common.refcount, 2); | 315 | atomic_set(&tt_local->common.refcount, 2); |
@@ -316,12 +320,6 @@ void batadv_tt_local_add(struct net_device *soft_iface, const uint8_t *addr, | |||
316 | if (batadv_compare_eth(addr, soft_iface->dev_addr)) | 320 | if (batadv_compare_eth(addr, soft_iface->dev_addr)) |
317 | tt_local->common.flags |= BATADV_TT_CLIENT_NOPURGE; | 321 | tt_local->common.flags |= BATADV_TT_CLIENT_NOPURGE; |
318 | 322 | ||
319 | /* The local entry has to be marked as NEW to avoid to send it in | ||
320 | * a full table response going out before the next ttvn increment | ||
321 | * (consistency check) | ||
322 | */ | ||
323 | tt_local->common.flags |= BATADV_TT_CLIENT_NEW; | ||
324 | |||
325 | hash_added = batadv_hash_add(bat_priv->tt.local_hash, batadv_compare_tt, | 323 | hash_added = batadv_hash_add(bat_priv->tt.local_hash, batadv_compare_tt, |
326 | batadv_choose_orig, &tt_local->common, | 324 | batadv_choose_orig, &tt_local->common, |
327 | &tt_local->common.hash_entry); | 325 | &tt_local->common.hash_entry); |