Re: [PATCH net-next] vrf: Add ip rules at vrf device create

2015-12-08 Thread David Ahern
On 12/8/15 4:54 AM, Nikolay Aleksandrov wrote: Hi, On 12/08/2015 04:55 AM, David Ahern wrote: [snip] +static inline size_t vrf_fib_rule_nl_size(bool have_pref) +{ + size_t sz; + + sz = NLMSG_ALIGN(sizeof(struct fib_rule_hdr)) ++ nla_total_size(IFNAMSIZ) /* F

Re: [PATCH net-next] vrf: Add ip rules at vrf device create

2015-12-08 Thread Nikolay Aleksandrov
Hi, On 12/08/2015 04:55 AM, David Ahern wrote: [snip] > > +static inline size_t vrf_fib_rule_nl_size(bool have_pref) > +{ > + size_t sz; > + > + sz = NLMSG_ALIGN(sizeof(struct fib_rule_hdr)) > + + nla_total_size(IFNAMSIZ) /* FRA_{I,O}IFNAME */ > +

[PATCH net-next] vrf: Add ip rules at vrf device create

2015-12-07 Thread David Ahern
VRFs require ip rules for route lookups to work properly. Currently creating a VRF means instantiating a device and then adding the 4 ip and ip6 rules: ip link add vrf-${VRF} type vrf table ${TBID} ip ru add oif vrf-${VRF} table ${TBID} ip ru add iif vrf-${VRF} table ${TBID} ip -6