On 10/29/20 4:28 PM, Vladimir Oltean wrote:
> @@ -168,9 +176,14 @@ static void print_mdb_entry(FILE *f, int ifindex, const 
> struct br_mdb_entry *e,
>       print_string(PRINT_ANY, "port", " port %s",
>                    ll_index_to_name(e->ifindex));
>  
> +     if (af == AF_INET || af == AF_INET6)
> +             addr = inet_ntop(af, grp, abuf, sizeof(abuf));
> +     else
> +             addr = ll_addr_n2a(grp, ETH_ALEN, 0, abuf, sizeof(abuf));
> +

The above can be replaced with a single call to rt_addr_n2a_r.

>       print_color_string(PRINT_ANY, ifa_family_color(af),
> -                         "grp", " grp %s",
> -                         inet_ntop(af, grp, abuf, sizeof(abuf)));
> +                         "grp", " grp %s", addr);
> +
>       if (tb && tb[MDBA_MDB_EATTR_SOURCE]) {
>               src = (const void *)RTA_DATA(tb[MDBA_MDB_EATTR_SOURCE]);
>               print_color_string(PRINT_ANY, ifa_family_color(af),

I think the rest is ok.

Reply via email to