From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sowmini Varadhan Subject: Re: [PATCH net-next 2/3] rds: Enable RDS IPv6 support Date: Mon, 25 Jun 2018 13:03:17 -0400 Message-ID: <20180625170317.GA28578@oracle.com> References: <7f4f460079d3d78a18f7d759488048798e99c4db.1529922794.git.ka-cheong.poon@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, santosh.shilimkar@oracle.com, davem@davemloft.net, rds-devel@oss.oracle.com To: Ka-Cheong Poon Return-path: Received: from aserp2120.oracle.com ([141.146.126.78]:44266 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754918AbeFYRDc (ORCPT ); Mon, 25 Jun 2018 13:03:32 -0400 Content-Disposition: inline In-Reply-To: <7f4f460079d3d78a18f7d759488048798e99c4db.1529922794.git.ka-cheong.poon@oracle.com> Sender: netdev-owner@vger.kernel.org List-ID: On (06/25/18 03:38), Ka-Cheong Poon wrote: > @@ -1105,8 +1105,27 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len) > break; > > case sizeof(*sin6): { > - ret = -EPROTONOSUPPORT; > - goto out; > + int addr_type; : : > + daddr = sin6->sin6_addr; > + dport = sin6->sin6_port; > + scope_id = sin6->sin6_scope_id; > + break; > } In rds_sendmsg, the scopeid passed to rds_conn_create_outgoing may come from the msg_name (if msg_name is a link-local) or may come from the rs_bound_scope_id (for connected socket, change made in Patch 1 of the series). This sounds inconsistent. If I bind to scopeid if1 and then send to fe80::1%if2 (without connect()), we'd create an rds_connection with dev_if set to if2. (first off, its a bit unexpected to be sending to fe80::1%if2 when you are bound to a link-local on if1!) But then, if we got back a response from fe80::1%if2, I think we would not find a matching conn in rds_recv_incoming? And this is even more confusing because the fastpath in rds_sendmsg does not take the bound_scope_id into consideration at all: 1213 if (rs->rs_conn && ipv6_addr_equal(&rs->rs_conn->c_faddr, &daddr)) 1214 conn = rs->rs_conn; 1215 else { 1216 conn = rds_conn_create_outgoing( /* .. */, scope_id) so if I erroneously passed a msg_name on a connected rds socket, what would happen? (see also question about rds_connect() itself, below) Should we always use rs_bound_scope_id for creating the outgoing rds_connection? (you may need something deterministic for this, like "if bound addr is linklocal, return error if daddr has a different scopeid, else use the bound addr's scopeid", plus, "if bound addr is not global, and daddr is link-local, we need a conn with the daddr's scopeid") Also, why is there no IPv6 support in rds_connect? (still looking through the rds-tcp changes, but wanted to get these questions clarified first). --Sowmini