From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753299AbcKMAvP (ORCPT ); Sat, 12 Nov 2016 19:51:15 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:45862 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751919AbcKMAvN (ORCPT ); Sat, 12 Nov 2016 19:51:13 -0500 X-ME-Sender: Message-Id: <1478998272.2299343.785875225.19237693@webmail.messagingengine.com> From: Hannes Frederic Sowa To: "Jason A. Donenfeld" , David Ahern Cc: Netdev , WireGuard mailing list , LKML , YOSHIFUJI Hideaki MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-d68eb56e In-Reply-To: References: <31e050e2-0499-a77e-f698-86e58ad2fa6b@cumulusnetworks.com> <0dbf5deb-bffb-4878-a268-1adb17c47676@cumulusnetworks.com> Date: Sun, 13 Nov 2016 01:51:12 +0100 Subject: Re: Source address fib invalidation on IPv6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 13, 2016, at 01:43, Jason A. Donenfeld wrote: > On Sat, Nov 12, 2016 at 8:08 PM, Jason A. Donenfeld > wrote: > >> Gotcha. I don't see any checks that the saddr is valid similar to what IPv4 does. > >> > >> I think the right place to add a check is in ip6_dst_lookup_tail(): > >> if (!ipv6_addr_any(&fl6->saddr)) { > >> // saddr is valid for L3 domain > >> } > > > > Right. It should probably do the check here, and return > > ERR_PTR(-EINVAL), the same as the v4 version, so that ret codes can be > > checked consistently. > > > > Thanks for looking into this. If you're backed up and would like me to > > submit a patch, just let me know, and I'll give it my best shot. > > In perusing through the v6 FIB code, I don't even see an analog of > __ip_dev_find... Hm? You probably need some combination of ipv6_chk_addr and/or ipv6_check_addr_and_flags (where dev can also be NULL). Be careful if a IFA_HOST or IFA_LINK address switches from one interface to another. Bye, Hannes From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Frederic Sowa Subject: Re: Source address fib invalidation on IPv6 Date: Sun, 13 Nov 2016 01:51:12 +0100 Message-ID: <1478998272.2299343.785875225.19237693@webmail.messagingengine.com> References: <31e050e2-0499-a77e-f698-86e58ad2fa6b@cumulusnetworks.com> <0dbf5deb-bffb-4878-a268-1adb17c47676@cumulusnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Netdev , LKML , WireGuard mailing list , YOSHIFUJI Hideaki To: "Jason A. Donenfeld" , David Ahern Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: wireguard-bounces@lists.zx2c4.com Sender: "WireGuard" List-Id: netdev.vger.kernel.org On Sun, Nov 13, 2016, at 01:43, Jason A. Donenfeld wrote: > On Sat, Nov 12, 2016 at 8:08 PM, Jason A. Donenfeld > wrote: > >> Gotcha. I don't see any checks that the saddr is valid similar to what IPv4 does. > >> > >> I think the right place to add a check is in ip6_dst_lookup_tail(): > >> if (!ipv6_addr_any(&fl6->saddr)) { > >> // saddr is valid for L3 domain > >> } > > > > Right. It should probably do the check here, and return > > ERR_PTR(-EINVAL), the same as the v4 version, so that ret codes can be > > checked consistently. > > > > Thanks for looking into this. If you're backed up and would like me to > > submit a patch, just let me know, and I'll give it my best shot. > > In perusing through the v6 FIB code, I don't even see an analog of > __ip_dev_find... Hm? You probably need some combination of ipv6_chk_addr and/or ipv6_check_addr_and_flags (where dev can also be NULL). Be careful if a IFA_HOST or IFA_LINK address switches from one interface to another. Bye, Hannes From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: hannes@stressinduktion.org Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 692a9933 for ; Sun, 13 Nov 2016 00:48:48 +0000 (UTC) Message-Id: <1478998272.2299343.785875225.19237693@webmail.messagingengine.com> From: Hannes Frederic Sowa To: "Jason A. Donenfeld" , David Ahern MIME-Version: 1.0 Content-Type: text/plain In-Reply-To: References: <31e050e2-0499-a77e-f698-86e58ad2fa6b@cumulusnetworks.com> <0dbf5deb-bffb-4878-a268-1adb17c47676@cumulusnetworks.com> Date: Sun, 13 Nov 2016 01:51:12 +0100 Cc: Netdev , LKML , WireGuard mailing list , YOSHIFUJI Hideaki Subject: Re: [WireGuard] Source address fib invalidation on IPv6 List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sun, Nov 13, 2016, at 01:43, Jason A. Donenfeld wrote: > On Sat, Nov 12, 2016 at 8:08 PM, Jason A. Donenfeld > wrote: > >> Gotcha. I don't see any checks that the saddr is valid similar to what IPv4 does. > >> > >> I think the right place to add a check is in ip6_dst_lookup_tail(): > >> if (!ipv6_addr_any(&fl6->saddr)) { > >> // saddr is valid for L3 domain > >> } > > > > Right. It should probably do the check here, and return > > ERR_PTR(-EINVAL), the same as the v4 version, so that ret codes can be > > checked consistently. > > > > Thanks for looking into this. If you're backed up and would like me to > > submit a patch, just let me know, and I'll give it my best shot. > > In perusing through the v6 FIB code, I don't even see an analog of > __ip_dev_find... Hm? You probably need some combination of ipv6_chk_addr and/or ipv6_check_addr_and_flags (where dev can also be NULL). Be careful if a IFA_HOST or IFA_LINK address switches from one interface to another. Bye, Hannes