Re: [RFC net-next 1/2] net: allow user to set IPv6 nexthop for IPv4 route

Sowmini Varadhan
2015-03-26T21:42:46Z

On Thu, Mar 26, 2015 at 5:05 PM, Andy Gospodarek
<gospo@cumulusnetworks.com> wrote:

> + if (nla_len(nla) == 4) {
> + nexthop_nh->nh_gw = nla ? nla_get_be32(nla) : 0;
> + } else if (nla_len(nla) == 16) {
> + nla_memcpy(&nexthop_nh->nh_gw6, nla, nla_len(nla));
> + } else return -EINVAL;

would be better to use sizeof (in_addr_t) and sizeof (struct in6_addr)
for clarity? same applies for:

> + if (!ipv6_addr_any(&nh->nh_gw6) &&
> + nla_put(skb, RTA_GATEWAY, 16, &nh->nh_gw6))
> + goto nla_put_failure;

I havent read the MPBGP spec, but I'm also intrigued by how ND and NUD
will work in this model, since the packet that triggers each is not an
ipv6 packet.

--Sowmini