On Mon, 2014-04-28 at 17:41 -0700, Justin Maggard wrote:
> If you are using a bond interface, the bond interface and the slave
> interfaces will share the same MAC address.  This can eventually
> cause connman to crash, because several things depend on a unique
> MAC address per interface.
> 
> We can just skip slave interfaces altogether, since connman can't
> do anything with them anyway.
> ---
>  src/rtnl.c |   12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/src/rtnl.c b/src/rtnl.c
> index be1bce9..19cbe20 100644
> --- a/src/rtnl.c
> +++ b/src/rtnl.c
> @@ -431,6 +431,13 @@ static void process_newlink(unsigned short type, int 
> index, unsigned flags,
>                                               address.ether_addr_octet[4],
>                                               address.ether_addr_octet[5]);
>  
> +     if ((flags & IFF_SLAVE) ||

This part of the test looks ok.

> +         memcmp(&address, &compare, ETH_ALEN) == 0) {

This part of the test breaks all rtnl messaging for interfaces that
don't have ethernet addressing. Cellular connections are the first ones
that comes to mind.

> +             connman_info("%s {newlink} skipping index %d address %s flags 
> %x",
> +                                             ifname, index, str, flags);
> +             return;
> +     }
> +

So slave interfaces should be filtered out if nothing else than ethernet
bonding creates them. The info output must spell out that it's filtered
out due to being a slave interface so we get better debugging.

>       switch (type) {
>       case ARPHRD_ETHER:
>       case ARPHRD_LOOPBACK:
> @@ -442,9 +449,8 @@ static void process_newlink(unsigned short type, int 
> index, unsigned flags,
>               break;
>       }
>  
> -     if (memcmp(&address, &compare, ETH_ALEN) != 0)
> -             connman_info("%s {newlink} index %d address %s mtu %u",
> -                                             ifname, index, str, mtu);
> +     connman_info("%s {newlink} index %d address %s mtu %u",
> +                                     ifname, index, str, mtu);

Yes, that 'if (memcmp...' looks a little artificial. Ok to remove it.

Cheers,

        Patrik


_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to