On 9/30/18 3:35 AM, Stephen Hemminger wrote:
> On Sat, 29 Sep 2018 10:59:21 -0700
> David Ahern <dsah...@kernel.org> wrote:
> 
>> From: David Ahern <dsah...@gmail.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 <dsah...@gmail.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.

Reply via email to