The neigh_list with batadv_hardif_neigh_node objects is accessed with only
rcu_read_lock in batadv_neigh_node_get and batadv_iv_neigh_print. Thus it
is not allowed to kfree the object before the rcu grace period ends (which
may still protects context accessing this object). Therefore the object has
first to be removed from the neigh_list and then it has either wait with
synchronize_rcu or call_rcu till the grace period ends before it can be
freed.
Fixes: fed2826b490c ("batman-adv: add list of unique single hop neighbors per hard-interface")
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
v2:
- split patchset into fixes and kref migration to make it easier when the
decision is made where each patch will be applied
net/batman-adv/originator.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 00b0437..2681c7d 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -217,10 +217,6 @@ static void batadv_hardif_neigh_free_rcu(struct rcu_head *rcu)
hardif_neigh = container_of(rcu, struct batadv_hardif_neigh_node, rcu);
- spin_lock_bh(&hardif_neigh->if_incoming->neigh_list_lock);
- hlist_del_init_rcu(&hardif_neigh->list);
- spin_unlock_bh(&hardif_neigh->if_incoming->neigh_list_lock);
-
batadv_hardif_free_ref_now(hardif_neigh->if_incoming);
kfree(hardif_neigh);
}
@@ -233,8 +229,13 @@ static void batadv_hardif_neigh_free_rcu(struct rcu_head *rcu)
static void
batadv_hardif_neigh_free_now(struct batadv_hardif_neigh_node *hardif_neigh)
{
- if (atomic_dec_and_test(&hardif_neigh->refcount))
+ if (atomic_dec_and_test(&hardif_neigh->refcount)) {
+ spin_lock_bh(&hardif_neigh->if_incoming->neigh_list_lock);
+ hlist_del_init_rcu(&hardif_neigh->list);
+ spin_unlock_bh(&hardif_neigh->if_incoming->neigh_list_lock);
+
batadv_hardif_neigh_free_rcu(&hardif_neigh->rcu);
+ }
}
/**
@@ -244,8 +245,13 @@ batadv_hardif_neigh_free_now(struct batadv_hardif_neigh_node *hardif_neigh)
*/
void batadv_hardif_neigh_free_ref(struct batadv_hardif_neigh_node *hardif_neigh)
{
- if (atomic_dec_and_test(&hardif_neigh->refcount))
+ if (atomic_dec_and_test(&hardif_neigh->refcount)) {
+ spin_lock_bh(&hardif_neigh->if_incoming->neigh_list_lock);
+ hlist_del_init_rcu(&hardif_neigh->list);
+ spin_unlock_bh(&hardif_neigh->if_incoming->neigh_list_lock);
+
call_rcu(&hardif_neigh->rcu, batadv_hardif_neigh_free_rcu);
+ }
}
/**
--
2.6.4
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
man/batctl.8 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/batctl.8 b/man/batctl.8
index 73d15e7..e804a08 100644
--- a/man/batctl.8
+++ b/man/batctl.8
@@ -186,7 +186,7 @@ Example 3: 16 or 0x0F
.IP
The batman-adv kernel module comes with a variety of debug tables containing various information about the state of the mesh
seen by each individual node. These tables are exported via debugfs and easily accessible via batctl. You will need debugfs
-support compiled into your kernel and preferrably have mounted the debugfs to a well-known mountpoint. If debugfs is not
+support compiled into your kernel and preferably have mounted the debugfs to a well-known mountpoint. If debugfs is not
mounted batctl will attempt to do this step for you.
All of the debug tables support the following options:
--
2.6.4
Hello Simon
Thanks for your input! I did not try that, but I have a Logilink
WL0084B adapter which has 150Mps only thus, I could never have a HT40
connection. Don't you agree?
Thanks
Richard
On 29 December 2015 at 15:36, Simon Müller <simon.f.mueller(a)gmail.com> wrote:
> Hi Richard,
>
> have you tried to set all devices to HT20?
>
> Regards, Simon
>
> 2015-12-29 13:42 GMT+01:00 no name <keinepostnurmuell(a)gmail.com>:
>>
>> I once again tried some settings and I want to use this message as a
>> bump. I am close to certain, that the RT5370 (rt2800usb) drivers are
>> to blame, but I hope some of you guys have some input for me:
>>
>> Here is the output from batctl td -x 1 bat0 when my client is being
>> pinged with a hop node in between:
>>
>> 21:24:36.769860 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 5, length 64
>> 21:24:36.770399 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 5, length 64
>> 21:24:37.266371 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
>> Request from b2:d5:c7:9e:49:96, length 331
>> 21:24:37.461997 IP6 fe80::c489:38ff:fe52:b84b >
>> fe80::b0d5:c7ff:fe9e:4996 ICMP6 neighbor solicitation, who has
>> fe80::b0d5:c7ff:fe9e:4996, length 72
>> 21:24:37.465750 IP6 fe80::b0d5:c7ff:fe9e:4996 >
>> fe80::c489:38ff:fe52:b84b ICMP6 neighbor advertisement, tgt is
>> fe80::b0d5:c7ff:fe9e:4996, length 64
>> 21:24:37.769275 ARP, Request who-has 192.168.2.213 tell 192.168.2.1
>> (b2:d5:c7:9e:49:96), length 28
>> 21:24:37.769834 ARP, Reply 192.168.2.213 is-at c6:89:38:52:b8:4b, length
>> 28
>> 21:24:37.770174 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 6, length 64
>> 21:24:37.770398 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 6, length 64
>> 21:24:38.770444 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 7, length 64
>> 21:24:38.770959 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 7, length 64
>> 21:24:39.772064 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 8, length 64
>> 21:24:39.772547 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 8, length 64
>> 21:24:40.774724 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 9, length 64
>> 21:24:40.775103 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 9, length 64
>> 21:24:41.778532 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 10, length 64
>> 21:24:41.778937 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 10, length 64
>> 21:24:42.205531 IP6 fe80::1cbf:71ff:fe42:cc98 > ff02::1:ff9e:4996
>> ICMP6 neighbor solicitation, who has fe80::b0d5:c7ff:fe9e:4996, length
>> 72
>> 21:24:42.287275 IP6 fe80::b0d5:c7ff:fe9e:4996.16962 > ff02::1.16962:
>> UDP, length 4
>> 21:24:42.456688 IP6 fe80::c489:38ff:fe52:b84b.16962 >
>> fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 64
>> 21:24:42.457072 IP6 fe80::c489:38ff:fe52:b84b.16962 >
>> fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 8
>> 21:24:42.771977 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
>> (c6:89:38:52:b8:4b), length 28
>> 21:24:43.771977 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
>> (c6:89:38:52:b8:4b), length 28
>> 21:24:43.779838 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 12, length 64
>> 21:24:43.780191 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 12, length 64
>> 21:24:44.771969 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
>> (c6:89:38:52:b8:4b), length 28
>> 21:24:48.319048 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
>> Request from c6:89:38:52:b8:4b, length 332
>> 21:24:51.165017 ARP, Request who-has 192.168.2.1 tell 192.168.2.212
>> (1e:bf:71:42:cc:98), length 28
>> 21:24:52.165044 ARP, Request who-has 192.168.2.1 tell 192.168.2.212
>> (1e:bf:71:42:cc:98), length 28
>> 21:24:52.212253 IP6 fe80::b0d5:c7ff:fe9e:4996.16962 > ff02::1.16962:
>> UDP, length 4
>> 21:24:52.456960 IP6 fe80::c489:38ff:fe52:b84b.16962 >
>> fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 64
>> 21:24:52.457448 IP6 fe80::c489:38ff:fe52:b84b.16962 >
>> fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 8
>> 21:24:55.421775 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
>> (c6:89:38:52:b8:4b), length 28
>> 21:24:55.445452 ARP, Reply 192.168.2.1 is-at b2:d5:c7:9e:49:96, length 28
>> 21:24:55.446159 IP 192.168.2.213.44353 > 79.140.41.209.1883: TCP,
>> Flags [...PA.], length 2
>> 21:24:55.780191 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 24, length 64
>> 21:24:55.780571 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 24, length 64
>> 21:24:56.783649 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 25, length 64
>> 21:24:56.784025 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 25, length 64
>> 21:24:57.788219 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 26, length 64
>> 21:24:57.788734 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 26, length 64
>> 21:24:58.788459 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 27, length 64
>> 21:24:58.788969 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 27, length 64
>> 21:24:59.788102 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> 1326, seq 28, length 64
>> 21:24:59.788613 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> 1326, seq 28, length 64
>>
>> As you can see, I get a lot of ARP requests, indicating, that my
>> clients are loosing the connection farily often, resulting exactly in
>> the observed behavior. I really would appreciate some help, or even a
>> hinch in some direction what could lead further ...
>>
>> Has ever someone tried to use 20+ raspberries in a meshed network as
>> nodes and hops?
>>
>> Thanks
>> Richard
>>
>> On 28 December 2015 at 23:43, no name <keinepostnurmuell(a)gmail.com> wrote:
>> > I once again tried some settings and I want to use this message as a
>> > bump. I am close to certain, that the RT5370 (rt2800usb) drivers are
>> > to blame, but I hope some of you guys have some input for me:
>> >
>> > Here is the output from batctl td -x 1 bat0 when my client is being
>> > pinged with a hop node in between:
>> >
>> > 21:24:36.769860 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 5, length 64
>> > 21:24:36.770399 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 5, length 64
>> > 21:24:37.266371 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
>> > Request from b2:d5:c7:9e:49:96, length 331
>> > 21:24:37.461997 IP6 fe80::c489:38ff:fe52:b84b >
>> > fe80::b0d5:c7ff:fe9e:4996 ICMP6 neighbor solicitation, who has
>> > fe80::b0d5:c7ff:fe9e:4996, length 72
>> > 21:24:37.465750 IP6 fe80::b0d5:c7ff:fe9e:4996 >
>> > fe80::c489:38ff:fe52:b84b ICMP6 neighbor advertisement, tgt is
>> > fe80::b0d5:c7ff:fe9e:4996, length 64
>> > 21:24:37.769275 ARP, Request who-has 192.168.2.213 tell 192.168.2.1
>> > (b2:d5:c7:9e:49:96), length 28
>> > 21:24:37.769834 ARP, Reply 192.168.2.213 is-at c6:89:38:52:b8:4b, length
>> > 28
>> > 21:24:37.770174 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 6, length 64
>> > 21:24:37.770398 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 6, length 64
>> > 21:24:38.770444 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 7, length 64
>> > 21:24:38.770959 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 7, length 64
>> > 21:24:39.772064 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 8, length 64
>> > 21:24:39.772547 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 8, length 64
>> > 21:24:40.774724 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 9, length 64
>> > 21:24:40.775103 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 9, length 64
>> > 21:24:41.778532 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 10, length 64
>> > 21:24:41.778937 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 10, length 64
>> > 21:24:42.205531 IP6 fe80::1cbf:71ff:fe42:cc98 > ff02::1:ff9e:4996
>> > ICMP6 neighbor solicitation, who has fe80::b0d5:c7ff:fe9e:4996, length
>> > 72
>> > 21:24:42.287275 IP6 fe80::b0d5:c7ff:fe9e:4996.16962 > ff02::1.16962:
>> > UDP, length 4
>> > 21:24:42.456688 IP6 fe80::c489:38ff:fe52:b84b.16962 >
>> > fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 64
>> > 21:24:42.457072 IP6 fe80::c489:38ff:fe52:b84b.16962 >
>> > fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 8
>> > 21:24:42.771977 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
>> > (c6:89:38:52:b8:4b), length 28
>> > 21:24:43.771977 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
>> > (c6:89:38:52:b8:4b), length 28
>> > 21:24:43.779838 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 12, length 64
>> > 21:24:43.780191 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 12, length 64
>> > 21:24:44.771969 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
>> > (c6:89:38:52:b8:4b), length 28
>> > 21:24:48.319048 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
>> > Request from c6:89:38:52:b8:4b, length 332
>> > 21:24:51.165017 ARP, Request who-has 192.168.2.1 tell 192.168.2.212
>> > (1e:bf:71:42:cc:98), length 28
>> > 21:24:52.165044 ARP, Request who-has 192.168.2.1 tell 192.168.2.212
>> > (1e:bf:71:42:cc:98), length 28
>> > 21:24:52.212253 IP6 fe80::b0d5:c7ff:fe9e:4996.16962 > ff02::1.16962:
>> > UDP, length 4
>> > 21:24:52.456960 IP6 fe80::c489:38ff:fe52:b84b.16962 >
>> > fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 64
>> > 21:24:52.457448 IP6 fe80::c489:38ff:fe52:b84b.16962 >
>> > fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 8
>> > 21:24:55.421775 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
>> > (c6:89:38:52:b8:4b), length 28
>> > 21:24:55.445452 ARP, Reply 192.168.2.1 is-at b2:d5:c7:9e:49:96, length
>> > 28
>> > 21:24:55.446159 IP 192.168.2.213.44353 > 79.140.41.209.1883: TCP,
>> > Flags [...PA.], length 2
>> > 21:24:55.780191 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 24, length 64
>> > 21:24:55.780571 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 24, length 64
>> > 21:24:56.783649 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 25, length 64
>> > 21:24:56.784025 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 25, length 64
>> > 21:24:57.788219 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 26, length 64
>> > 21:24:57.788734 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 26, length 64
>> > 21:24:58.788459 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 27, length 64
>> > 21:24:58.788969 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 27, length 64
>> > 21:24:59.788102 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
>> > 1326, seq 28, length 64
>> > 21:24:59.788613 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
>> > 1326, seq 28, length 64
>> >
>> > As you can see, I get a lot of ARP requests, indicating, that my
>> > clients are loosing the connection farily often, resulting exactly in
>> > the observed behavior. I really would appreciate some help, or even a
>> > hinch in some direction what could lead further ...
>> >
>> > Has ever someone tried to use 20+ raspberries in a meshed network as
>> > nodes and hops?
>> >
>> > Thanks
>> > Richard
>> >
>> > On 21 December 2015 at 16:32, <b.a.t.m.a.n-owner(a)lists.open-mesh.org>
>> > wrote:
>> >> Message rejected by filter rule match
>> >>
>> >>
>> >>
>> >> ---------- Forwarded message ----------
>> >> From: no name <keinepostnurmuell(a)gmail.com>
>> >> To: The list for a Better Approach To Mobile Ad-hoc Networking
>> >> <b.a.t.m.a.n(a)lists.open-mesh.org>
>> >> Cc:
>> >> Date: Mon, 21 Dec 2015 16:32:36 +0100
>> >> Subject: Re: [B.A.T.M.A.N.] Super high package loss and weak connection
>> >> Right now I am working on a new set of measurements with the basis as
>> >> follows:
>> >>
>> >> Raspberry Pi b+ with a LOGILINK WL0084B USB Stick on Jessie with Kernel
>> >> 4.1.13+, batman2015-0
>> >>
>> >> I tested:
>> >>
>> >> Batman + Ad-Hoc
>> >> Batman + 802.11s
>> >> only 802.11s
>> >>
>> >> against each other. This lead to the following results:
>> >>
>> >> All of the above configurations show basically the same behaviour:
>> >> When pinging, the reply times from directly connected nodes are really
>> >> stable (1-4ms, depends on the range).
>> >> When pinging via one hop in between, the network seems to take some
>> >> breaks. A burst of pings (5-10) are replied pretty accurate, but always
>> >> followed by a really long break of about 2-3 seconds
>> >>
>> >> The problem is less intense when using the batman configurations
>> >> (->actually does rout better (: ).
>> >>
>> >> Facing this results I think I might be staring at a driver's issue, but
>> >> still wanted to see if anyone here can help me with ideas.
>> >>
>> >> Thanks everyone for the time and help!
>> >>
>> >> Richard
>> >>
>> >>
>> >>> ---------- Forwarded message ----------
>> >>> From: Sven Eckelmann <sven(a)narfation.org>
>> >>> Date: 18 December 2015 at 18:30
>> >>> Subject: Re: [B.A.T.M.A.N.] Super high package loss and weak
>> >>> connection
>> >>> To: no name <keinepostnurmuell(a)gmail.com>
>> >>> Cc: The list for a Better Approach To Mobile Ad-hoc Networking
>> >>> <b.a.t.m.a.n(a)lists.open-mesh.org>
>> >>>
>> >>>
>> >>> On Friday 18 December 2015 18:22:40 no name wrote:
>> >>> > I made a little table were I tried wheezy against jessy and 802.11
>> >>> > as
>> >>> > someone suggested earlier in the mailing list to me. I placed the
>> >>> > raspberries next to each other on my table and tested through
>> >>> > different
>> >>> > settings:
>> >>> >
>> >>> > ad-hoc+batman-2014.X@debian wheezy: 1m distance .. 200
>> >>> > pings, 0%
>> >>> > paket loss, reply time -> (min,avg,max,mdev 1.2ms, 1.8ms, 6.4ms,
>> >>> > 0.8ms)
>> >>> > ad-hoc+batman-2015.2@debian jessie: 1m distance .. 200
>> >>> > pings,
>> >>> > 6% paket loss, reply time -> (min,avg,max,mdev 1.1ms, 170ms, 1400ms,
>> >>> > 370ms)
>> >>> > 802.11s @debian jessie: 1m distance
>> >>> > ..
>> >>> > 200 pings, 0% paket loss, reply time -> (min,avg,max,mdev 1.05ms,
>> >>> > 1.8ms,
>> >>> > 14ms, 1.5ms)
>> >>>
>> >>> Your "table" is incomplete. adhoc without batman-adv and meshpoint
>> >>> (802.11s
>> >>> without fwding+ttl=1)+batman-adv are missing. You also mixed two
>> >>> different
>> >>> batman-adv versions. Either you use the same batman-adv version
>> >>> everywhere or
>> >>> make sure that the kernel+wifi driver doesn't change. Changing
>> >>> multiple
>> >>> variables between two tests tests make the results more or less
>> >>> useless for
>> >>> comparisons.
>> >>>
>> >>> Kind regards,
>> >>> Sven
>> >>>
>> >>
>> >>
>
>
>
The length check never used the mesh_iface length in the size calculation.
Instead it used the length of the mountpoint and the format string. But the
length of the format string is not the length of the final string.
Instead remove this check and depend completely on the return value of
snprintf.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
debugfs.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/debugfs.c b/debugfs.c
index 04e47e9..3c58195 100644
--- a/debugfs.c
+++ b/debugfs.c
@@ -42,19 +42,12 @@ static const char *debugfs_known_mountpoints[] = {
/* construct a full path to a debugfs element */
int debugfs_make_path(const char *fmt, char *mesh_iface, char *buffer, int size)
{
- int len;
-
if (strlen(debugfs_mountpoint) == 0) {
buffer[0] = '\0';
return -1;
}
- len = strlen(debugfs_mountpoint) + strlen(fmt) + 1;
- if (len >= size)
- return len+1;
-
- snprintf(buffer, size-1, fmt, debugfs_mountpoint, mesh_iface);
- return 0;
+ return snprintf(buffer, size, fmt, debugfs_mountpoint, mesh_iface);
}
static int debugfs_found;
--
2.6.4
batadv_iv_ogm_orig_del_if removes a part of the bcast_own which previously
belonged to the now removed interface. This is done by copying all data
which comes before the removed interface and then appending all the data
which comes after the removed interface.
The address calculation for the position of the data which comes after the
removed interface assumed that the bat_iv.bcast_own is a pointer to a
single byte datatype. But it is a pointer to unsigned long and thus the
calculated position was wrong off factor sizeof(unsigned long).
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
---
net/batman-adv/bat_iv_ogm.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index ad678f0..a6d389b 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -185,7 +185,8 @@ unlock:
static int batadv_iv_ogm_orig_del_if(struct batadv_orig_node *orig_node,
int max_if_num, int del_if_num)
{
- int chunk_size, ret = -ENOMEM, if_offset;
+ int ret = -ENOMEM;
+ size_t chunk_size, if_offset;
void *data_ptr = NULL;
spin_lock_bh(&orig_node->bat_iv.ogm_cnt_lock);
@@ -203,8 +204,9 @@ static int batadv_iv_ogm_orig_del_if(struct batadv_orig_node *orig_node,
memcpy(data_ptr, orig_node->bat_iv.bcast_own, del_if_num * chunk_size);
/* copy second part */
+ if_offset = (del_if_num + 1) * chunk_size;
memcpy((char *)data_ptr + del_if_num * chunk_size,
- orig_node->bat_iv.bcast_own + ((del_if_num + 1) * chunk_size),
+ (uint8_t *)orig_node->bat_iv.bcast_own + if_offset,
(max_if_num - del_if_num) * chunk_size);
free_bcast_own:
--
2.6.2
I once again tried some settings and I want to use this message as a
bump. I am close to certain, that the RT5370 (rt2800usb) drivers are
to blame, but I hope some of you guys have some input for me:
Here is the output from batctl td -x 1 bat0 when my client is being
pinged with a hop node in between:
21:24:36.769860 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 5, length 64
21:24:36.770399 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 5, length 64
21:24:37.266371 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
Request from b2:d5:c7:9e:49:96, length 331
21:24:37.461997 IP6 fe80::c489:38ff:fe52:b84b >
fe80::b0d5:c7ff:fe9e:4996 ICMP6 neighbor solicitation, who has
fe80::b0d5:c7ff:fe9e:4996, length 72
21:24:37.465750 IP6 fe80::b0d5:c7ff:fe9e:4996 >
fe80::c489:38ff:fe52:b84b ICMP6 neighbor advertisement, tgt is
fe80::b0d5:c7ff:fe9e:4996, length 64
21:24:37.769275 ARP, Request who-has 192.168.2.213 tell 192.168.2.1
(b2:d5:c7:9e:49:96), length 28
21:24:37.769834 ARP, Reply 192.168.2.213 is-at c6:89:38:52:b8:4b, length 28
21:24:37.770174 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 6, length 64
21:24:37.770398 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 6, length 64
21:24:38.770444 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 7, length 64
21:24:38.770959 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 7, length 64
21:24:39.772064 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 8, length 64
21:24:39.772547 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 8, length 64
21:24:40.774724 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 9, length 64
21:24:40.775103 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 9, length 64
21:24:41.778532 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 10, length 64
21:24:41.778937 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 10, length 64
21:24:42.205531 IP6 fe80::1cbf:71ff:fe42:cc98 > ff02::1:ff9e:4996
ICMP6 neighbor solicitation, who has fe80::b0d5:c7ff:fe9e:4996, length
72
21:24:42.287275 IP6 fe80::b0d5:c7ff:fe9e:4996.16962 > ff02::1.16962:
UDP, length 4
21:24:42.456688 IP6 fe80::c489:38ff:fe52:b84b.16962 >
fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 64
21:24:42.457072 IP6 fe80::c489:38ff:fe52:b84b.16962 >
fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 8
21:24:42.771977 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
(c6:89:38:52:b8:4b), length 28
21:24:43.771977 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
(c6:89:38:52:b8:4b), length 28
21:24:43.779838 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 12, length 64
21:24:43.780191 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 12, length 64
21:24:44.771969 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
(c6:89:38:52:b8:4b), length 28
21:24:48.319048 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
Request from c6:89:38:52:b8:4b, length 332
21:24:51.165017 ARP, Request who-has 192.168.2.1 tell 192.168.2.212
(1e:bf:71:42:cc:98), length 28
21:24:52.165044 ARP, Request who-has 192.168.2.1 tell 192.168.2.212
(1e:bf:71:42:cc:98), length 28
21:24:52.212253 IP6 fe80::b0d5:c7ff:fe9e:4996.16962 > ff02::1.16962:
UDP, length 4
21:24:52.456960 IP6 fe80::c489:38ff:fe52:b84b.16962 >
fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 64
21:24:52.457448 IP6 fe80::c489:38ff:fe52:b84b.16962 >
fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 8
21:24:55.421775 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
(c6:89:38:52:b8:4b), length 28
21:24:55.445452 ARP, Reply 192.168.2.1 is-at b2:d5:c7:9e:49:96, length 28
21:24:55.446159 IP 192.168.2.213.44353 > 79.140.41.209.1883: TCP,
Flags [...PA.], length 2
21:24:55.780191 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 24, length 64
21:24:55.780571 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 24, length 64
21:24:56.783649 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 25, length 64
21:24:56.784025 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 25, length 64
21:24:57.788219 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 26, length 64
21:24:57.788734 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 26, length 64
21:24:58.788459 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 27, length 64
21:24:58.788969 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 27, length 64
21:24:59.788102 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
1326, seq 28, length 64
21:24:59.788613 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
1326, seq 28, length 64
As you can see, I get a lot of ARP requests, indicating, that my
clients are loosing the connection farily often, resulting exactly in
the observed behavior. I really would appreciate some help, or even a
hinch in some direction what could lead further ...
Has ever someone tried to use 20+ raspberries in a meshed network as
nodes and hops?
Thanks
Richard
On 28 December 2015 at 23:43, no name <keinepostnurmuell(a)gmail.com> wrote:
> I once again tried some settings and I want to use this message as a
> bump. I am close to certain, that the RT5370 (rt2800usb) drivers are
> to blame, but I hope some of you guys have some input for me:
>
> Here is the output from batctl td -x 1 bat0 when my client is being
> pinged with a hop node in between:
>
> 21:24:36.769860 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 5, length 64
> 21:24:36.770399 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 5, length 64
> 21:24:37.266371 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
> Request from b2:d5:c7:9e:49:96, length 331
> 21:24:37.461997 IP6 fe80::c489:38ff:fe52:b84b >
> fe80::b0d5:c7ff:fe9e:4996 ICMP6 neighbor solicitation, who has
> fe80::b0d5:c7ff:fe9e:4996, length 72
> 21:24:37.465750 IP6 fe80::b0d5:c7ff:fe9e:4996 >
> fe80::c489:38ff:fe52:b84b ICMP6 neighbor advertisement, tgt is
> fe80::b0d5:c7ff:fe9e:4996, length 64
> 21:24:37.769275 ARP, Request who-has 192.168.2.213 tell 192.168.2.1
> (b2:d5:c7:9e:49:96), length 28
> 21:24:37.769834 ARP, Reply 192.168.2.213 is-at c6:89:38:52:b8:4b, length 28
> 21:24:37.770174 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 6, length 64
> 21:24:37.770398 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 6, length 64
> 21:24:38.770444 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 7, length 64
> 21:24:38.770959 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 7, length 64
> 21:24:39.772064 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 8, length 64
> 21:24:39.772547 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 8, length 64
> 21:24:40.774724 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 9, length 64
> 21:24:40.775103 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 9, length 64
> 21:24:41.778532 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 10, length 64
> 21:24:41.778937 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 10, length 64
> 21:24:42.205531 IP6 fe80::1cbf:71ff:fe42:cc98 > ff02::1:ff9e:4996
> ICMP6 neighbor solicitation, who has fe80::b0d5:c7ff:fe9e:4996, length
> 72
> 21:24:42.287275 IP6 fe80::b0d5:c7ff:fe9e:4996.16962 > ff02::1.16962:
> UDP, length 4
> 21:24:42.456688 IP6 fe80::c489:38ff:fe52:b84b.16962 >
> fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 64
> 21:24:42.457072 IP6 fe80::c489:38ff:fe52:b84b.16962 >
> fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 8
> 21:24:42.771977 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
> (c6:89:38:52:b8:4b), length 28
> 21:24:43.771977 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
> (c6:89:38:52:b8:4b), length 28
> 21:24:43.779838 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 12, length 64
> 21:24:43.780191 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 12, length 64
> 21:24:44.771969 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
> (c6:89:38:52:b8:4b), length 28
> 21:24:48.319048 IP 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP,
> Request from c6:89:38:52:b8:4b, length 332
> 21:24:51.165017 ARP, Request who-has 192.168.2.1 tell 192.168.2.212
> (1e:bf:71:42:cc:98), length 28
> 21:24:52.165044 ARP, Request who-has 192.168.2.1 tell 192.168.2.212
> (1e:bf:71:42:cc:98), length 28
> 21:24:52.212253 IP6 fe80::b0d5:c7ff:fe9e:4996.16962 > ff02::1.16962:
> UDP, length 4
> 21:24:52.456960 IP6 fe80::c489:38ff:fe52:b84b.16962 >
> fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 64
> 21:24:52.457448 IP6 fe80::c489:38ff:fe52:b84b.16962 >
> fe80::b0d5:c7ff:fe9e:4996.16962: UDP, length 8
> 21:24:55.421775 ARP, Request who-has 192.168.2.1 tell 192.168.2.213
> (c6:89:38:52:b8:4b), length 28
> 21:24:55.445452 ARP, Reply 192.168.2.1 is-at b2:d5:c7:9e:49:96, length 28
> 21:24:55.446159 IP 192.168.2.213.44353 > 79.140.41.209.1883: TCP,
> Flags [...PA.], length 2
> 21:24:55.780191 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 24, length 64
> 21:24:55.780571 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 24, length 64
> 21:24:56.783649 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 25, length 64
> 21:24:56.784025 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 25, length 64
> 21:24:57.788219 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 26, length 64
> 21:24:57.788734 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 26, length 64
> 21:24:58.788459 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 27, length 64
> 21:24:58.788969 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 27, length 64
> 21:24:59.788102 IP 192.168.2.1 > 192.168.2.213: ICMP echo request, id
> 1326, seq 28, length 64
> 21:24:59.788613 IP 192.168.2.213 > 192.168.2.1: ICMP echo reply, id
> 1326, seq 28, length 64
>
> As you can see, I get a lot of ARP requests, indicating, that my
> clients are loosing the connection farily often, resulting exactly in
> the observed behavior. I really would appreciate some help, or even a
> hinch in some direction what could lead further ...
>
> Has ever someone tried to use 20+ raspberries in a meshed network as
> nodes and hops?
>
> Thanks
> Richard
>
> On 21 December 2015 at 16:32, <b.a.t.m.a.n-owner(a)lists.open-mesh.org> wrote:
>> Message rejected by filter rule match
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: no name <keinepostnurmuell(a)gmail.com>
>> To: The list for a Better Approach To Mobile Ad-hoc Networking <b.a.t.m.a.n(a)lists.open-mesh.org>
>> Cc:
>> Date: Mon, 21 Dec 2015 16:32:36 +0100
>> Subject: Re: [B.A.T.M.A.N.] Super high package loss and weak connection
>> Right now I am working on a new set of measurements with the basis as follows:
>>
>> Raspberry Pi b+ with a LOGILINK WL0084B USB Stick on Jessie with Kernel 4.1.13+, batman2015-0
>>
>> I tested:
>>
>> Batman + Ad-Hoc
>> Batman + 802.11s
>> only 802.11s
>>
>> against each other. This lead to the following results:
>>
>> All of the above configurations show basically the same behaviour:
>> When pinging, the reply times from directly connected nodes are really stable (1-4ms, depends on the range).
>> When pinging via one hop in between, the network seems to take some breaks. A burst of pings (5-10) are replied pretty accurate, but always followed by a really long break of about 2-3 seconds
>>
>> The problem is less intense when using the batman configurations (->actually does rout better (: ).
>>
>> Facing this results I think I might be staring at a driver's issue, but still wanted to see if anyone here can help me with ideas.
>>
>> Thanks everyone for the time and help!
>>
>> Richard
>>
>>
>>> ---------- Forwarded message ----------
>>> From: Sven Eckelmann <sven(a)narfation.org>
>>> Date: 18 December 2015 at 18:30
>>> Subject: Re: [B.A.T.M.A.N.] Super high package loss and weak connection
>>> To: no name <keinepostnurmuell(a)gmail.com>
>>> Cc: The list for a Better Approach To Mobile Ad-hoc Networking <b.a.t.m.a.n(a)lists.open-mesh.org>
>>>
>>>
>>> On Friday 18 December 2015 18:22:40 no name wrote:
>>> > I made a little table were I tried wheezy against jessy and 802.11 as
>>> > someone suggested earlier in the mailing list to me. I placed the
>>> > raspberries next to each other on my table and tested through different
>>> > settings:
>>> >
>>> > ad-hoc+batman-2014.X@debian wheezy: 1m distance .. 200 pings, 0%
>>> > paket loss, reply time -> (min,avg,max,mdev 1.2ms, 1.8ms, 6.4ms, 0.8ms)
>>> > ad-hoc+batman-2015.2@debian jessie: 1m distance .. 200 pings,
>>> > 6% paket loss, reply time -> (min,avg,max,mdev 1.1ms, 170ms, 1400ms, 370ms)
>>> > 802.11s @debian jessie: 1m distance ..
>>> > 200 pings, 0% paket loss, reply time -> (min,avg,max,mdev 1.05ms, 1.8ms,
>>> > 14ms, 1.5ms)
>>>
>>> Your "table" is incomplete. adhoc without batman-adv and meshpoint (802.11s
>>> without fwding+ttl=1)+batman-adv are missing. You also mixed two different
>>> batman-adv versions. Either you use the same batman-adv version everywhere or
>>> make sure that the kernel+wifi driver doesn't change. Changing multiple
>>> variables between two tests tests make the results more or less useless for
>>> comparisons.
>>>
>>> Kind regards,
>>> Sven
>>>
>>
>>
On Friday 18 December 2015 18:22:40 no name wrote:
> I made a little table were I tried wheezy against jessy and 802.11 as
> someone suggested earlier in the mailing list to me. I placed the
> raspberries next to each other on my table and tested through different
> settings:
>
> ad-hoc+batman-2014.X@debian wheezy: 1m distance .. 200 pings, 0%
> paket loss, reply time -> (min,avg,max,mdev 1.2ms, 1.8ms, 6.4ms, 0.8ms)
> ad-hoc+batman-2015.2@debian jessie: 1m distance .. 200 pings,
> 6% paket loss, reply time -> (min,avg,max,mdev 1.1ms, 170ms, 1400ms, 370ms)
> 802.11s @debian jessie: 1m distance ..
> 200 pings, 0% paket loss, reply time -> (min,avg,max,mdev 1.05ms, 1.8ms,
> 14ms, 1.5ms)
Your "table" is incomplete. adhoc without batman-adv and meshpoint (802.11s
without fwding+ttl=1)+batman-adv are missing. You also mixed two different
batman-adv versions. Either you use the same batman-adv version everywhere or
make sure that the kernel+wifi driver doesn't change. Changing multiple
variables between two tests tests make the results more or less useless for
comparisons.
Kind regards,
Sven