Re: [PATCH net-next iproute2 1/3] netlink: import netlink message parsing from kernel

2017-05-02 Thread Stephen Hemminger
On Tue, 2 May 2017 14:39:40 -0600 David Ahern wrote: > On 5/2/17 1:49 PM, Stephen Hemminger wrote: > > I am not disagreeing that iproute2 should handle the extended > > error format. Just want the solution to be as small as possible; > > ie do no more than is absolutely necessary. And future proo

Re: [PATCH net-next iproute2 1/3] netlink: import netlink message parsing from kernel

2017-05-02 Thread David Ahern
On 5/2/17 1:49 PM, Stephen Hemminger wrote: > I am not disagreeing that iproute2 should handle the extended > error format. Just want the solution to be as small as possible; > ie do no more than is absolutely necessary. And future proof > for the inevitable growth in new area. Understood. I was t

Re: [PATCH net-next iproute2 1/3] netlink: import netlink message parsing from kernel

2017-05-02 Thread Stephen Hemminger
I am not disagreeing that iproute2 should handle the extended error format. Just want the solution to be as small as possible; ie do no more than is absolutely necessary. And future proof for the inevitable growth in new area. > + > +static const __u8 nla_attr_minlen[NLA_TYPE_MAX+1] = { > + [N

Re: [PATCH net-next iproute2 1/3] netlink: import netlink message parsing from kernel

2017-05-02 Thread David Miller
From: David Ahern Date: Tue, 2 May 2017 12:39:51 -0600 > On 5/2/17 12:03 PM, Stephen Hemminger wrote: >> Then use libmnl it is already used in several other places in iproute2. >> Eventually, I would like to use it everywhere and get rid of old netlink >> parser. >> > > Why? libmnl is not goin

Re: [PATCH net-next iproute2 1/3] netlink: import netlink message parsing from kernel

2017-05-02 Thread David Ahern
On 5/2/17 12:03 PM, Stephen Hemminger wrote: > Then use libmnl it is already used in several other places in iproute2. > Eventually, I would like to use it everywhere and get rid of old netlink > parser. > Why? libmnl is not going to simplify the iproute2 code. Look at attribute validation. Imp

Re: [PATCH net-next iproute2 1/3] netlink: import netlink message parsing from kernel

2017-05-02 Thread Stephen Hemminger
On Tue, 02 May 2017 13:00:32 -0400 (EDT) David Miller wrote: > From: David Ahern > Date: Tue, 2 May 2017 10:51:23 -0600 > > > On 5/2/17 9:25 AM, Stephen Hemminger wrote: > >> Please either use existing netlink attribute code in libnetlink.h > >> (rta_getattr_u32 etc) or use libmnl like devlin

Re: [PATCH net-next iproute2 1/3] netlink: import netlink message parsing from kernel

2017-05-02 Thread David Miller
From: David Ahern Date: Tue, 2 May 2017 10:51:23 -0600 > On 5/2/17 9:25 AM, Stephen Hemminger wrote: >> Please either use existing netlink attribute code in libnetlink.h >> (rta_getattr_u32 etc) or use libmnl like devlink. > > All of the existing rta_ functions take a struct rta_attr; netlink >

Re: [PATCH net-next iproute2 1/3] netlink: import netlink message parsing from kernel

2017-05-02 Thread David Ahern
On 5/2/17 9:25 AM, Stephen Hemminger wrote: > Please either use existing netlink attribute code in libnetlink.h > (rta_getattr_u32 etc) or use libmnl like devlink. All of the existing rta_ functions take a struct rta_attr; netlink messages use struct nlattr. It's just wrong to use rta functions fo

Re: [PATCH net-next iproute2 1/3] netlink: import netlink message parsing from kernel

2017-05-02 Thread Stephen Hemminger
On Mon, 1 May 2017 20:18:23 -0700 David Ahern wrote: > include/nlattr.h is pulled from include/net/netlink.h. > lib/nlattr.c is pulled from lib/nlattr.c > > Signed-off-by: David Ahern No. I am not taking a third way of parsing netlink attributes. Please either use existing netlink attribute

[PATCH net-next iproute2 1/3] netlink: import netlink message parsing from kernel

2017-05-01 Thread David Ahern
include/nlattr.h is pulled from include/net/netlink.h. lib/nlattr.c is pulled from lib/nlattr.c Signed-off-by: David Ahern --- include/libnetlink.h | 8 +++ include/nlattr.h | 162 +++ lib/Makefile | 2 +- lib/libnetlink.c | 4