Hey Linus,
I'm currently playing a little with this patchset ...
On Tue, Aug 13, 2013 at 10:23:58AM +0200, Linus Lüssing wrote:
[...]
- count = atomic_read(&tt_global_entry->orig_list_count);
[...]
- atomic_inc(&tt_global->orig_list_count);
[...]
atomic_set(&tt_global_entry->orig_list_count, 0);
[...] @@ -830,12 +833,14 @@ struct batadv_tt_local_entry {
- struct batadv_tt_global_entry - translation table global entry data
- @common: general translation table data
- @orig_list: list of orig nodes announcing this non-mesh client
*/
- @orig_list_count: number of items in the orig_list
- @list_lock: lock protecting orig_list
- @roam_at: time at which TT_GLOBAL_ROAM was set
struct batadv_tt_global_entry { struct batadv_tt_common_entry common; struct hlist_head orig_list;
- atomic_t orig_list_count; spinlock_t list_lock; /* protects orig_list */ unsigned long roam_at;
You never decrease this orig_list_count, do you? But actually you should when a node leaves the group. What I've tried is:
Node 1 pings a multicast address -> no group member, nothing is sent Node 2 is added to the group -> multicast is now sent as unicast Node 3 is added to the group -> multicast is now sent as broadcast Node 2 is removed from the group -> multicast is still sent as broadcast (should be unicast!) Node 3 is removed from the group -> nothing is sent (as to be expected).
Could you please check the removal case?
Thanks, Simon