Re: [PATCH v2 iproute2] ip: support for xfrm interfaces

2019-01-21 Thread David Ahern
On 1/21/19 10:05 AM, Matt Ellison wrote: > On Mon, 21 Jan 2019 09:14:52 -0700 David Ahern wrote: > >> You always add IF_ID even if not set by user. The kernel code does not >> appear to require it so why pass a default value? > > 0 (the default) is a valid IF_ID, so setting an interface with a n

Re: [PATCH v2 iproute2] ip: support for xfrm interfaces

2019-01-21 Thread Matt Ellison
On Mon, 21 Jan 2019 09:14:52 -0700 David Ahern wrote: > You always add IF_ID even if not set by user. The kernel code does not > appear to require it so why pass a default value? 0 (the default) is a valid IF_ID, so setting an interface with a non-zero IF_ID back to 0 is possible. I think the b

Re: [PATCH v2 iproute2] ip: support for xfrm interfaces

2019-01-21 Thread David Ahern
On 1/17/19 7:40 AM, Matt Ellison wrote: > +static int xfrm_parse_opt(struct link_util *lu, int argc, char **argv, > + struct nlmsghdr *n) > +{ > + unsigned int link = 0; > + __u32 if_id = 0; > + > + while (argc > 0) { > + if (!matches(*argv, "dev")) { >

[PATCH v2 iproute2] ip: support for xfrm interfaces

2019-01-17 Thread Matt Ellison
Interfaces take a 'if_id' which is an interface id which can be set on an xfrm policy as its interface lookup key (XFRMA_IF_ID). Signed-off-by: Matt Ellison --- ip/Makefile | 2 +- ip/iplink.c | 3 +- ip/link_xfrm.c