lkml.org 
[lkml]   [2020]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 iproute2-next] bridge: add support for L2 multicast groups
From
Date
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.

\
 
 \ /
  Last update: 2020-11-06 17:40    [W:0.033 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site