From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: Re: [PATCH iproute2-next 00/12] Updates for strict checking and kernel side filtering Date: Sun, 30 Dec 2018 16:17:58 +0200 Message-ID: <20181230141758.GA4376@splinter.mtl.com> References: <20181220035427.14453-1-dsahern@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, stephen@networkplumber.org, David Ahern To: David Ahern Return-path: Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55565 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbeL3OSE (ORCPT ); Sun, 30 Dec 2018 09:18:04 -0500 Content-Disposition: inline In-Reply-To: <20181220035427.14453-1-dsahern@kernel.org> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Dec 19, 2018 at 07:54:15PM -0800, David Ahern wrote: > From: David Ahern > > Refactorings and updates to use the new strict checking in the kernel > along with the new kernel side filtering. David, Since this was applied to iproute2-next I get: bash-4.4# bridge/bridge fdb show [ 5365.137224] netlink: 4 bytes leftover after parsing attributes in process `bridge'. Error: bytes leftover after parsing attributes. Dump terminated And a lot of tests are failing. Given you enabled strict checking, I assume we should be using 'struct ndmsg' in FDB dump? Following patch fixes it for me. I can submit formally if you don't already have a patch. diff --git a/bridge/fdb.c b/bridge/fdb.c index a5abc1b6c78d..a7a0d8052307 100644 --- a/bridge/fdb.c +++ b/bridge/fdb.c @@ -260,16 +260,16 @@ static int fdb_show(int argc, char **argv) { struct { struct nlmsghdr n; - struct ifinfomsg ifm; + struct ndmsg ndm; char buf[256]; } req = { - .n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)), - .ifm.ifi_family = PF_BRIDGE, + .n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ndmsg)), + .ndm.ndm_family = PF_BRIDGE, }; char *filter_dev = NULL; char *br = NULL; - int msg_size = sizeof(struct ifinfomsg); + int msg_size = sizeof(struct ndmsg); while (argc > 0) { if ((strcmp(*argv, "brport") == 0) || strcmp(*argv, "dev") == 0) { @@ -313,10 +313,10 @@ static int fdb_show(int argc, char **argv) filter_index = ll_name_to_index(filter_dev); if (!filter_index) return nodev(filter_dev); - req.ifm.ifi_index = filter_index; + req.ndm.ndm_ifindex = filter_index; } - if (rtnl_dump_request(&rth, RTM_GETNEIGH, &req.ifm, msg_size) < 0) { + if (rtnl_dump_request(&rth, RTM_GETNEIGH, &req.ndm, msg_size) < 0) { perror("Cannot send dump request"); exit(1); }