Re: [B.A.T.M.A.N.] [PATCH-maint 4/4] batman-adv: detect local excess vlans in TT request

Simon Wunderlich
2015-08-25T21:12:17Z

[-- Attachment #1: Type: text/plain, Size: 1278 bytes --]

On Tuesday 25 August 2015 20:28:48 Antonio Quartulli wrote:
> On 25/08/15 17:31, Simon Wunderlich wrote:
> >> batadv_orig_node_vlan_get() returns NULL if we don't know this VLAN for
> >> that Originator, therefore the CRC check fails here.
> >
> > That's right, however it only sweeps through the VLANs announced within
> > the
> > TT-TVLV. However, my addition tries to check if there are any excess VLAN
> > locally which are NOT in that TT-TVLV. I think this patch doesn't take
> > care of that, or am I missing something?
> >
> > For example, think of having VLAN 6 locally with a couple of global
> > entries at the originator, but the TT-TVLV only announces VLANs 3,4,5.
> > Then the fact that we also have VLAN 6 is not detected, and these
> > (probably wrong) entries are never cleaned up.
>
> Right, this check is required, but what about just checking the VLAN
> count in the tt packet and in the originator struct ? if the number is
> different it means that there must be an excess in the local struct.

You are right, just counting would be way simpler than comparing for the right
VLANs (since we don't use that information anyway). And this patch also did
not unlock the rcu-lock properly ... I'll resend this one with the simpler
method.

Thanks!
Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 181 bytes --]