Re: [B.A.T.M.A.N.] [RFC] batman-adv: Remove recursive bat-on-bat netdevice check

Antonio Quartulli
2016-01-19T00:39:07Z

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

Hi Sven and thanks for this RFC. Sorry for taking soo long to comment.

On 14/11/15 03:46, Sven Eckelmann wrote:
> batman-adv checks in different situation if a new device is already on top
> of a different batman-adv device. This is done by getting the iflink of a
> device and all its parent. It assumes that this iflink is always a parent
> device in an acyclic graph. But this assumption is broken by devices like
> veth which are actually a pair of two devices linked to each other. The
> recursive check would therefore get veth0 when calling dev_get_iflink on
> veth1. And it gets veth0 when calling dev_get_iflink with veth1.
>

I agree that this check implemented this way represents a problem.
However I also believe that we should still have some kind of prevention
against this particular scenario (chain of batman interfaces), because
if ignored it could lead to troubles.

Unfortunately I don't know how to implement this check in an elegant and
extendible manner.

First of all we should add a check that follows the master interface,
but at the same time we should still follow the iflink, otherwise we
can't check relationships like VLAN_DEV->REAL_DEV. But how to implement
the latter without hitting the cyclic case is not clear to me ..

An option is to add a specific check for veth and break the recursion,
but this is not really nice, because the next time a cyclic interface
type will be introduced our check will become troublesome again.

Suggestions?

Cheers,

--
Antonio Quartulli

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]