All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: David Ahern <dsahern@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH v4 net-next 2/6] net/ipv6: Change address check to always take a device argument
Date: Wed, 14 Mar 2018 14:22:17 +0200	[thread overview]
Message-ID: <20180314122217.GB20522@splinter> (raw)
In-Reply-To: <20180313152941.31218-3-dsahern@gmail.com>

On Tue, Mar 13, 2018 at 08:29:37AM -0700, David Ahern wrote:
> ipv6_chk_addr_and_flags determines if an address is a local address and
> optionally if it is an address on a specific device. For example, it is
> called by ip6_route_info_create to determine if a given gateway address
> is a local address. The address check currently does not consider L3
> domains and as a result does not allow a route to be added in one VRF
> if the nexthop points to an address in a second VRF. e.g.,
> 
>     $ ip route add 2001:db8:1::/64 vrf r2 via 2001:db8:102::23
>     Error: Invalid gateway address.
> 
> where 2001:db8:102::23 is an address on an interface in vrf r1.
> 
> ipv6_chk_addr_and_flags needs to allow callers to always pass in a device
> with a separate argument to not limit the address to the specific device.
> The device is used used to determine the L3 domain of interest.
> 
> To that end add an argument to skip the device check and update callers
> to always pass a device where possible and use the new argument to mean
> any address in the domain.
> 
> Update a handful of users of ipv6_chk_addr with a NULL dev argument. This
> patch handles the change to these callers without adding the domain check.
> 
> ip6_validate_gw needs to handle 2 cases - one where the device is given
> as part of the nexthop spec and the other where the device is resolved.
> There is at least 1 VRF case where deferring the check to only after
> the route lookup has resolved the device fails with an unintuitive error
> "RTNETLINK answers: No route to host" as opposed to the preferred
> "Error: Gateway can not be a local address." The 'no route to host'
> error is because of the fallback to a full lookup. The check is done
> twice to avoid this error.
> 
> Signed-off-by: David Ahern <dsahern@gmail.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>

Thanks for the detailed commit message.

  reply	other threads:[~2018-03-14 12:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 15:29 [PATCH v4 net-next 0/6] net/ipv6: Address checks need to consider the L3 domain David Ahern
2018-03-13 15:29 ` [PATCH v4 net-next 1/6] net/ipv6: Refactor gateway validation on route add David Ahern
2018-03-14 12:21   ` Ido Schimmel
2018-03-13 15:29 ` [PATCH v4 net-next 2/6] net/ipv6: Change address check to always take a device argument David Ahern
2018-03-14 12:22   ` Ido Schimmel [this message]
2018-03-13 15:29 ` [PATCH v4 net-next 3/6] net/ipv6: Add l3mdev check to ipv6_chk_addr_and_flags David Ahern
2018-03-14 12:25   ` Ido Schimmel
2018-03-13 15:29 ` [PATCH v4 net-next 4/6] selftests: fib_tests: Use an alias for ip command David Ahern
2018-03-13 15:29 ` [PATCH v4 net-next 5/6] selftests: fib_tests: Allow user to run a specific test David Ahern
2018-03-13 15:29 ` [PATCH v4 net-next 6/6] selftests: fib_tests: Add IPv6 nexthop spec tests David Ahern
2018-03-16 15:29 ` [PATCH v4 net-next 0/6] net/ipv6: Address checks need to consider the L3 domain David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180314122217.GB20522@splinter \
    --to=idosch@idosch.org \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.