[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e659f87f-35fc-01f1-167f-0d5e06690991@oracle.com>
Date: Tue, 31 Jul 2018 10:45:13 -0700
From: Santosh Shilimkar <santosh.shilimkar@...cle.com>
To: Ka-Cheong Poon <ka-cheong.poon@...cle.com>, netdev@...r.kernel.org
Cc: davem@...emloft.net, rds-devel@....oracle.com
Subject: Re: [PATCH net-next 2/2] rds: Remove IPv6 dependency
On 7/30/2018 10:48 PM, Ka-Cheong Poon wrote:
> This patch removes the IPv6 dependency from RDS.
>
> Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@...cle.com>
> ---
> net/rds/Kconfig | 2 +-
> net/rds/af_rds.c | 32 +++++++++++++++++++-------------
> net/rds/bind.c | 4 +++-
> net/rds/connection.c | 26 ++++++++++++++++++++++++--
> net/rds/ib.c | 31 ++++++++++++++++++++++++++-----
> net/rds/ib_cm.c | 9 +++++++++
> net/rds/ib_rdma.c | 2 ++
> net/rds/rdma_transport.c | 10 ++++++++++
> net/rds/recv.c | 2 ++
> net/rds/send.c | 2 ++
> net/rds/tcp.c | 25 +++++++++++++++++++++++++
> net/rds/tcp_listen.c | 21 +++++++++++++++++----
> 12 files changed, 140 insertions(+), 26 deletions(-)
>
> diff --git a/net/rds/Kconfig b/net/rds/Kconfig
> index 4c7f259..41f7556 100644
> --- a/net/rds/Kconfig
> +++ b/net/rds/Kconfig
> @@ -1,7 +1,7 @@
>
> config RDS
> tristate "The RDS Protocol"
> - depends on INET && IPV6
> + depends on INET
Thanks for followup Ka-Cheong.
> diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
> index fc5c48b..65387e1 100644
> --- a/net/rds/af_rds.c
> +++ b/net/rds/af_rds.c
> @@ -156,18 +156,20 @@ static int rds_getname(struct socket *sock, struct sockaddr *uaddr,
> return sizeof(*sin);
> }
>
> - if (ipv6_addr_type(&rs->rs_conn_addr) &
> - IPV6_ADDR_MAPPED) {
> - sin = (struct sockaddr_in *)uaddr;
> - memset(sin, 0, sizeof(*sin));
> - sin->sin_family = AF_INET;
> - return sizeof(*sin);
> +#if IS_ENABLED(CONFIG_IPV6)
> + if (!(ipv6_addr_type(&rs->rs_conn_addr) &
> + IPV6_ADDR_MAPPED)) {
> + sin6 = (struct sockaddr_in6 *)uaddr;
> + memset(sin6, 0, sizeof(*sin6));
> + sin6->sin6_family = AF_INET6;
> + return sizeof(*sin6);
> }
> +#endif
>
I don't like this #ifdef spaghetti all over in the middle functions
but seems like that is the best option considering the involved
changes from previous series.
FWIW,
Acked-by: Santosh Shilimkar <santosh.shilimkar@...cle.com>
Powered by blists - more mailing lists