[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dc10a907-a6aa-3058-455f-363abccf9340@gmail.com>
Date: Sun, 30 Sep 2018 09:37:20 -0600
From: David Ahern <dsahern@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>,
David Ahern <dsahern@...nel.org>
Cc: netdev@...r.kernel.org, christian@...uner.io
Subject: Re: [PATCH iproute2-next 01/11] libnetlink: Convert GETADDR dumps to
use rtnl_addrdump_req
On 9/30/18 3:35 AM, Stephen Hemminger wrote:
> On Sat, 29 Sep 2018 10:59:21 -0700
> David Ahern <dsahern@...nel.org> wrote:
>
>> From: David Ahern <dsahern@...il.com>
>>
>> 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 <dsahern@...il.com>
>
> }
>>
>> +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.
Powered by blists - more mailing lists