From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH iproute2-next 01/11] libnetlink: Convert GETADDR dumps to use rtnl_addrdump_req Date: Sun, 30 Sep 2018 09:37:20 -0600 Message-ID: References: <20180929175931.18448-1-dsahern@kernel.org> <20180929175931.18448-2-dsahern@kernel.org> <20180930113541.4bf9113d@shemminger-XPS-13-9360> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, christian@brauner.io To: Stephen Hemminger , David Ahern Return-path: Received: from mail-pg1-f196.google.com ([209.85.215.196]:33124 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727715AbeI3WKw (ORCPT ); Sun, 30 Sep 2018 18:10:52 -0400 Received: by mail-pg1-f196.google.com with SMTP id y18-v6so7729643pge.0 for ; Sun, 30 Sep 2018 08:37:23 -0700 (PDT) In-Reply-To: <20180930113541.4bf9113d@shemminger-XPS-13-9360> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 9/30/18 3:35 AM, Stephen Hemminger wrote: > On Sat, 29 Sep 2018 10:59:21 -0700 > David Ahern wrote: > >> From: David Ahern >> >> Add rtnl_addrdump_req for address dumps using the proper ifaddrmsg >> as the header. Convert existing RTM_GETADDR dumps to use it. >> >> Signed-off-by: David Ahern > > } >> >> +int rtnl_addrdump_req(struct rtnl_handle *rth, int family) >> +{ >> + struct { >> + struct nlmsghdr nlh; >> + struct ifaddrmsg ifm; >> + } req = { >> + .nlh.nlmsg_len = sizeof(req), >> + .nlh.nlmsg_type = RTM_GETADDR, >> + .nlh.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST, >> + .nlh.nlmsg_seq = rth->dump = ++rth->seq, >> + .ifm.ifa_family = family, >> + }; > > > This could be: > } req = { > .nlh = { > .nlmsg_len = sizeof(req), > .nlmsg_type = RTM_GETADDR, > ... > I kept the inline because it is the style everywhere else in the iproute2 code.