[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180630.175049.1607480149466051192.davem@davemloft.net>
Date: Sat, 30 Jun 2018 17:50:49 +0900 (KST)
From: David Miller <davem@...emloft.net>
To: ka-cheong.poon@...cle.com
Cc: netdev@...r.kernel.org, santosh.shilimkar@...cle.com,
rds-devel@....oracle.com
Subject: Re: [PATCH v2 net-next 1/3] rds: Changing IP address internal
representation to struct in6_addr
From: Ka-Cheong Poon <ka-cheong.poon@...cle.com>
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 <ka-cheong.poon@...cle.com>
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.
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.
Powered by blists - more mailing lists