Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp224286pxu; Thu, 22 Oct 2020 21:37:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+zsXtoFOMjIhzfcCUqQwq0D/fpXz+WZ1ETjQn7M8qky7mjqgQhcqqyZmcS+vW+WB6QBoS X-Received: by 2002:aa7:c90a:: with SMTP id b10mr464723edt.163.1603427841195; Thu, 22 Oct 2020 21:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603427841; cv=none; d=google.com; s=arc-20160816; b=Xg1RvYIfC+Y/MFEjCX8j+iLm3qHHwDsovcB3elVJppzIHgeilMPt4ry41lCMA1ObRW Hh1rAZRQCty3TJq8cCxAb6FNqaGvYrwFhADb0K9E3FrbCx6t5Aj6wvSbZRqyGdmxgv64 OC7GkjrRpLPGufJG3xK9sBanl2bYtQ/MfbJiFZBTmezbEnXZv7Q3VoGM6u7pTR1yI7rk PvpSMuDAwBSwq1DIMH5GOSYh0DtXSxrw2IUFOP9ym+Q8YQ1LD1rkAa73wcNpiD0BWWMK 9CpD4iNAq3t5m5ezIm9LF5hEW1S7Wl1YdhLwAwwj7wP3Q5xj0ma2V5iNqpZHLMFxIN9P MSdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=3dm/6UU7gzYtewq70pBYmJhrFBt9p+uK9v/LY5XBQe8=; b=Cx1CDlyArsfKHqDktzcexpXeytDzGRAtQV1TeqEaXiXmSJEci0PGwGS0vzRC7RGCzD 6vdFnshDV3vbVk1gd30OkCzXOh5njv6H+IKpzGw19SyqQ0luqMleVL2NkZq+0g7OwZFp mEC9o3z4CqYh/+EE7sdEVEyeWvC9ZSuljhtcj9C4bAJnJBTN03vTjK8ucroCv3yOhblM AaMih1D5SlbO5dmyWc9iXY+K42tXwU70I3qQbzj4S90BVSNUZtXEWl9wnWItOj4c6g4/ rQukgFVOeh/FvriPKKurXkohA0cwKE7ZT6X2r6Je5iQRZqFA2UxSCX76dT1LkpUia8A1 vHjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=WdHQm9X1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l2si128741ejf.667.2020.10.22.21.36.59; Thu, 22 Oct 2020 21:37:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=WdHQm9X1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S370430AbgJVTwa (ORCPT + 99 others); Thu, 22 Oct 2020 15:52:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2509834AbgJVTw3 (ORCPT ); Thu, 22 Oct 2020 15:52:29 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3311C0613CE for ; Thu, 22 Oct 2020 12:52:29 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id j5so1147995plk.7 for ; Thu, 22 Oct 2020 12:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3dm/6UU7gzYtewq70pBYmJhrFBt9p+uK9v/LY5XBQe8=; b=WdHQm9X1Ao2rROrM/DL9Ob5ETV5dcmcxbbi05C5ioxMtbjEFPu3amCoERC6BHS5ppC jUCpJ54iUYioZDSSbRWoRxCclHJU2JtZBbuzhQKlaoGfRi2P3C3aoYELYkdM3Ek82NIg /ql2TOC/FiXWF3ne/NQAZ463k3oht0RbEiVAsKFptqY+29o7VcNwnZHW3zobc8msa2X1 zO5gOJQMcdg6oEVFJShVA7kglwRFhbHPbFKzO/ozeQPE39n/MLVVx9kgdzBxWcAPTbDC +1ZEfeuMQ8ZS2WXFxUtATlwTjKv7PedQHfi0mdzi0cs+G6RgmmJ67hNItyrWmZIM4FVf /Txw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3dm/6UU7gzYtewq70pBYmJhrFBt9p+uK9v/LY5XBQe8=; b=mSDtHe2HT/TDwul4uwfg8nq/JTb70uTnyKITn06hapdmp4mD9cu31GSNT0lP694x4O USqWE7wmTeAtFW2Ucl8NQCQPpE9NUg12Wl0Rbk2DijajnKAjEzBvw/QGqZi2lyVBQ723 QGAkV7F1YnJDOJ4p1UqTKW07wigw5wZdi0q2Uv6M+zdaCoBd1tb6zfVDaXZmwbqs0mko osp+ZtM9yzm/0Dnu0O6RkpCaD30lOeTckq9GKgp2UnWvi03W7ixxd15SRD6CeF81R0go WRmx0EiyJcVAf7MdDxG+O3loFHd201hc5MLyXDi3Qz7jFeHwyN/4MpU/1oOXHn8NX0MS uoCg== X-Gm-Message-State: AOAM531yVmLU5FY4FemQ8jVXiAGYm1/uzzre5jkk41MRcs+K/CYEKWvw 3qD4Fn9I/Pvz+t/91zF0z0IGPw== X-Received: by 2002:a17:902:d697:b029:d6:48f:2974 with SMTP id v23-20020a170902d697b02900d6048f2974mr3724561ply.30.1603396349196; Thu, 22 Oct 2020 12:52:29 -0700 (PDT) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id b6sm2981568pjq.42.2020.10.22.12.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 12:52:28 -0700 (PDT) Date: Thu, 22 Oct 2020 12:52:20 -0700 From: Stephen Hemminger To: Vladimir Oltean Cc: David Ahern , Roopa Prabhu , Nikolay Aleksandrov , "David S. Miller" , Jakub Kicinski , bridge@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com, jiri@mellanox.com, idosch@idosch.org Subject: Re: [RFC PATCH iproute2] bridge: add support for L2 multicast groups Message-ID: <20201022125220.45c24b30@hermes.local> In-Reply-To: <20201017184526.2333840-1-vladimir.oltean@nxp.com> References: <20201017184526.2333840-1-vladimir.oltean@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 17 Oct 2020 21:45:26 +0300 Vladimir Oltean wrote: > Extend the 'bridge mdb' command for the following syntax: > bridge mdb add dev br0 port swp0 grp 01:02:03:04:05:06 permanent > > Signed-off-by: Vladimir Oltean > --- > bridge/mdb.c | 54 ++++++++++++++++++++++++++-------- > include/uapi/linux/if_bridge.h | 2 ++ > 2 files changed, 43 insertions(+), 13 deletions(-) > > diff --git a/bridge/mdb.c b/bridge/mdb.c > index 4cd7ca762b78..af160250928e 100644 > --- a/bridge/mdb.c > +++ b/bridge/mdb.c > @@ -149,6 +149,7 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e, > struct nlmsghdr *n, struct rtattr **tb) > { > const void *grp, *src; > + const char *addr; > SPRINT_BUF(abuf); > const char *dev; > int af; > @@ -156,9 +157,16 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e, > if (filter_vlan && e->vid != filter_vlan) > return; > > - af = e->addr.proto == htons(ETH_P_IP) ? AF_INET : AF_INET6; > - grp = af == AF_INET ? (const void *)&e->addr.u.ip4 : > - (const void *)&e->addr.u.ip6; > + if (!e->addr.proto) { > + af = AF_PACKET; > + grp = (const void *)&e->addr.u.mac_addr; > + } else if (e->addr.proto == htons(ETH_P_IP)) { > + af = AF_INET; > + grp = (const void *)&e->addr.u.ip4; > + } else { > + af = AF_INET6; > + grp = (const void *)&e->addr.u.ip6; > + } > dev = ll_index_to_name(ifindex); > In C casts of pointer to void are not necessary.