From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f49.google.com ([209.85.160.49]:46089 "EHLO mail-pl0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932147AbeCFSdC (ORCPT ); Tue, 6 Mar 2018 13:33:02 -0500 Received: by mail-pl0-f49.google.com with SMTP id y8-v6so12325393pll.13 for ; Tue, 06 Mar 2018 10:33:02 -0800 (PST) Subject: Re: [PATCH v2 net-next 2/5] net/ipv6: Address checks need to consider the L3 domain To: Ido Schimmel Cc: netdev@vger.kernel.org References: <20180305213406.13628-1-dsahern@gmail.com> <20180305213406.13628-3-dsahern@gmail.com> <20180306150148.GA6675@splinter> From: David Ahern Message-ID: <7e6fda9a-2585-772d-b3d9-9a796e79dbe1@gmail.com> Date: Tue, 6 Mar 2018 11:32:59 -0700 MIME-Version: 1.0 In-Reply-To: <20180306150148.GA6675@splinter> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On 3/6/18 8:01 AM, Ido Schimmel wrote: > On Mon, Mar 05, 2018 at 01:34:03PM -0800, David Ahern wrote: >> ipv6_chk_addr_and_flags determines if an address is a local address. It >> is called by ip6_route_info_create to validate a gateway address is not a >> local address. It 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. >> >> Resolve by comparing the l3mdev for the passed in device and requiring an >> l3mdev match with the device containing an address. The intent of checking >> for an address on the specified device versus any device in the domain is >> mantained by a new argument to skip the check between the passed in device >> and the device with the address. >> >> Update the handful of users of ipv6_chk_addr with a NULL dev argument: > > I see at least two callers from net/sctp/ipv6.c that pass a NULL > argument, which means they only want an address check, but you pass > 'false' to 'skip_dev_check'. right. I think ipv6_chk_addr should be passing dev == NULL for the skip_dev_check. Thanks for the review