From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ka-Cheong Poon Subject: Re: [PATCH v2 net-next 1/3] rds: Changing IP address internal representation to struct in6_addr Date: Tue, 3 Jul 2018 22:02:33 +0800 Message-ID: <4b00cb3a-0ed7-d746-8377-a0ee9d103cdf@oracle.com> References: <693463ed87c5956eed05a6266c4edf354ab3d51a.1530086216.git.ka-cheong.poon@oracle.com> <20180630.175049.1607480149466051192.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, santosh.shilimkar@oracle.com, rds-devel@oss.oracle.com To: David Miller Return-path: Received: from aserp2120.oracle.com ([141.146.126.78]:45392 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752863AbeGCOCq (ORCPT ); Tue, 3 Jul 2018 10:02:46 -0400 In-Reply-To: <20180630.175049.1607480149466051192.davem@davemloft.net> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 06/30/2018 04:50 PM, David Miller wrote: > From: Ka-Cheong Poon > Date: Wed, 27 Jun 2018 03:23:27 -0700 > >> This patch changes the internal representation of an IP address to use >> struct in6_addr. IPv4 address is stored as an IPv4 mapped address. >> All the functions which take an IP address as argument are also >> changed to use struct in6_addr. But RDS socket layer is not modified >> such that it still does not accept IPv6 address from an application. >> And RDS layer does not accept nor initiate IPv6 connections. >> >> v2: Fixed sparse warnings. >> >> Signed-off-by: Ka-Cheong Poon > > I really don't like this. > > An ipv4 mapped ipv6 address is not the same as an ipv4 address. > > You are effectively preventing the use of ipv6 connections > using ipv4 mapped addresses. Could you please clarify what is meant by an IPv6 connections using IPv4 mapped address? An IPv6 packet cannot use an IPv4 mapped address as source or destination address. Do you mean an app uses an IPv4 mapped address in a struct sockaddr_in6 to set up an IPv4 connection? Please note that this patch is patch #1. This patch alone does not support RDS/IPv6. Hence this patch has checks to prevent an app to use IPv6 address. Those checks will be removed in patch #2. > Also, assuming the sockaddr type based upon size is wrong. > You have to check the family field, then you can decide > to interpret the rest of the sockaddr in one way or another > and also validate it's length. > -- K. Poon ka-cheong.poon@oracle.com