The following commit has been merged in the next branch:
commit f8a89f0c03dadc2eb95481062b69c044442fdaa7
Merge: ec619d0f3b6438bbbcc8aeb5a9c0899f6cc491fb 76a7cd1d3775d31a333d958b57894ef01cefd208
Author: Marek Lindner <lindner_marek(a)yahoo.de>
Date: Mon Oct 17 14:43:45 2011 +0200
Merge branch 'next'
diff --combined translation-table.c
index d4a3917,873fb3d..c2af2b1
--- a/translation-table.c
+++ b/translation-table.c
@@@ -67,7 -67,7 +67,7 @@@ static struct tt_local_entry *tt_local_
struct hlist_head *head;
struct hlist_node *node;
struct tt_local_entry *tt_local_entry, *tt_local_entry_tmp = NULL;
- int index;
+ uint32_t index;
if (!hash)
return NULL;
@@@ -99,7 -99,7 +99,7 @@@ static struct tt_global_entry *tt_globa
struct hlist_node *node;
struct tt_global_entry *tt_global_entry;
struct tt_global_entry *tt_global_entry_tmp = NULL;
- int index;
+ uint32_t index;
if (!hash)
return NULL;
@@@ -304,8 -304,7 +304,8 @@@ int tt_local_seq_print_text(struct seq_
struct hlist_head *head;
size_t buf_size, pos;
char *buff;
- int i, ret = 0;
+ uint32_t i;
+ int ret = 0;
primary_if = primary_if_get_selected(bat_priv);
if (!primary_if) {
@@@ -416,7 -415,7 +416,7 @@@ static void tt_local_purge(struct bat_p
struct hlist_node *node, *node_tmp;
struct hlist_head *head;
spinlock_t *list_lock; /* protects write access to the hash lists */
- int i;
+ uint32_t i;
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
@@@ -454,7 -453,7 +454,7 @@@ static void tt_local_table_free(struct
struct tt_local_entry *tt_local_entry;
struct hlist_node *node, *node_tmp;
struct hlist_head *head;
- int i;
+ uint32_t i;
if (!bat_priv->tt_local_hash)
return;
@@@ -581,8 -580,7 +581,8 @@@ int tt_global_seq_print_text(struct seq
struct hlist_head *head;
size_t buf_size, pos;
char *buff;
- int i, ret = 0;
+ uint32_t i;
+ int ret = 0;
primary_if = primary_if_get_selected(bat_priv);
if (!primary_if) {
@@@ -706,7 -704,7 +706,7 @@@ void tt_global_del_orig(struct bat_pri
struct orig_node *orig_node, const char *message)
{
struct tt_global_entry *tt_global_entry;
- int i;
+ uint32_t i;
struct hashtable_t *hash = bat_priv->tt_global_hash;
struct hlist_node *node, *safe;
struct hlist_head *head;
@@@ -722,10 -720,9 +722,10 @@@
if (tt_global_entry->orig_node == orig_node) {
bat_dbg(DBG_TT, bat_priv,
"Deleting global tt entry %pM "
- "(via %pM): originator time out\n",
+ "(via %pM): %s\n",
tt_global_entry->addr,
- tt_global_entry->orig_node->orig);
+ tt_global_entry->orig_node->orig,
+ message);
hlist_del_rcu(node);
tt_global_entry_free_ref(tt_global_entry);
}
@@@ -742,7 -739,7 +742,7 @@@ static void tt_global_roam_purge(struc
struct hlist_node *node, *node_tmp;
struct hlist_head *head;
spinlock_t *list_lock; /* protects write access to the hash lists */
- int i;
+ uint32_t i;
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
@@@ -776,7 -773,7 +776,7 @@@ static void tt_global_table_free(struc
struct tt_global_entry *tt_global_entry;
struct hlist_node *node, *node_tmp;
struct hlist_head *head;
- int i;
+ uint32_t i;
if (!bat_priv->tt_global_hash)
return;
@@@ -862,8 -859,7 +862,8 @@@ uint16_t tt_global_crc(struct bat_priv
struct tt_global_entry *tt_global_entry;
struct hlist_node *node;
struct hlist_head *head;
- int i, j;
+ uint32_t i;
+ int j;
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
@@@ -900,8 -896,7 +900,8 @@@ uint16_t tt_local_crc(struct bat_priv *
struct tt_local_entry *tt_local_entry;
struct hlist_node *node;
struct hlist_head *head;
- int i, j;
+ uint32_t i;
+ int j;
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
@@@ -1038,7 -1033,7 +1038,7 @@@ static struct sk_buff *tt_response_fill
struct sk_buff *skb = NULL;
uint16_t tt_tot, tt_count;
ssize_t tt_query_size = sizeof(struct tt_query_packet);
- int i;
+ uint32_t i;
if (tt_query_size + tt_len > primary_if->soft_iface->mtu) {
tt_len = primary_if->soft_iface->mtu - tt_query_size;
@@@ -1054,7 -1049,6 +1054,6 @@@
tt_response = (struct tt_query_packet *)skb_put(skb,
tt_query_size + tt_len);
tt_response->ttvn = ttvn;
- tt_response->tt_data = htons(tt_tot);
tt_change = (struct tt_change *)(skb->data + tt_query_size);
tt_count = 0;
@@@ -1080,6 -1074,10 +1079,10 @@@
}
rcu_read_unlock();
+ /* store in the message the number of entries we have successfully
+ * copied */
+ tt_response->tt_data = htons(tt_count);
+
out:
return skb;
}
@@@ -1174,11 -1172,11 +1177,11 @@@ static bool send_other_tt_response(stru
(tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));
/* Let's get the orig node of the REAL destination */
- req_dst_orig_node = get_orig_node(bat_priv, tt_request->dst);
+ req_dst_orig_node = orig_hash_find(bat_priv, tt_request->dst);
if (!req_dst_orig_node)
goto out;
- res_dst_orig_node = get_orig_node(bat_priv, tt_request->src);
+ res_dst_orig_node = orig_hash_find(bat_priv, tt_request->src);
if (!res_dst_orig_node)
goto out;
@@@ -1304,7 -1302,7 +1307,7 @@@ static bool send_my_tt_response(struct
my_ttvn = (uint8_t)atomic_read(&bat_priv->ttvn);
req_ttvn = tt_request->ttvn;
- orig_node = get_orig_node(bat_priv, tt_request->src);
+ orig_node = orig_hash_find(bat_priv, tt_request->src);
if (!orig_node)
goto out;
@@@ -1712,7 -1710,7 +1715,7 @@@ void tt_free(struct bat_priv *bat_priv
* entry */
static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags)
{
- int i;
+ uint32_t i;
struct hashtable_t *hash = bat_priv->tt_local_hash;
struct hlist_head *head;
struct hlist_node *node;
@@@ -1745,7 -1743,7 +1748,7 @@@ static void tt_local_purge_pending_clie
struct hlist_node *node, *node_tmp;
struct hlist_head *head;
spinlock_t *list_lock; /* protects write access to the hash lists */
- int i;
+ uint32_t i;
if (!hash)
return;
--
batman-adv