Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp739427ybt; Fri, 26 Jun 2020 10:20:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0EYfHwHeFj9LBHMPlezUuLCQvzShpF+DcnKn3OMBYaOa0SLUNlmthVql1ME6koSMnMI3P X-Received: by 2002:a17:906:3152:: with SMTP id e18mr3627348eje.137.1593192030964; Fri, 26 Jun 2020 10:20:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593192030; cv=none; d=google.com; s=arc-20160816; b=Hsw25dDNL09YspGRw7imV47HXnX9nU9lTzrd0GEdCNgDb71pzflToGllqn5eVQIxyg Aikz4D9CezFB7/K40QeOrTmL81NakuUXaozbhWAprQGBoBJpFDbQLthyVwSfK6z/ip8k sD4SxhudGb7jhD9dWuT21BcfEAN0iOkdKMsgmLR7OolkXO6wjhtj15Om8eZzhau3RUwX 5/N+exFBszBCByUROAbObh5wVMT6c6kBiiW5MNFAL+SwO0BonKwhHUm2naBVYoR9Kkld Ue4q/gtcI2LPRn5b8uRvRi5MrJBdlnemOteyko6nXiKizop4mkR3TWeSqlyiG8vMLPhQ T0Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=F2iXBar5H5tbFtcbHzxR3C5SAl8ISMwpH/WrB4ZN3N8=; b=PlbZXRhtskM1E6Pv4quOvhTh0ciOPFj7TP5V1Ol4axabT2iiKtbj5arKfDAeR98/nH U6XkvU/eosBdHa4BRvCS16szm6VOYXrHBmjs4hCe2yHXj+NY23W67KWPWxOeXAFKAnhi d5WMVaHe+cLVQu5IR6q20wVYIvokPor8WSR96QCBVab2c6P+ejUS7A4OVK0lon/PuOLb Pk9N7mAp7+fwge2Mfxl2l/MdYoieRiJ5nGi11UlB0d9x8qNqN0j6/LX9YXwTi9G1lSxy p0aY3sAre46ln2LNLQqyZp5RMq5yOLGviWl5uo/kAj4N3z4i8aEr01uM8DG6c0sMkJvB FkOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si6898641edb.90.2020.06.26.10.20.08; Fri, 26 Jun 2020 10:20:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726874AbgFZQ1n convert rfc822-to-8bit (ORCPT + 99 others); Fri, 26 Jun 2020 12:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbgFZQ1m (ORCPT ); Fri, 26 Jun 2020 12:27:42 -0400 Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8333FC03E979; Fri, 26 Jun 2020 09:27:42 -0700 (PDT) Received: from mb.fritz.box (ip4d15f5fc.dynamic.kabel-deutschland.de [77.21.245.252]) (Authenticated sender: lurchi) by mail-n.franken.de (Postfix) with ESMTPSA id 7CF317220B813; Fri, 26 Jun 2020 18:27:36 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: Strange problem with SCTP+IPv6 From: Michael Tuexen In-Reply-To: <50b0a6ff186e408bbfe6211221cb3998@AcuMS.aculab.com> Date: Fri, 26 Jun 2020 18:27:35 +0200 Cc: Xin Long , Marcelo Ricardo Leitner , "minyard@acm.org" , Vlad Yasevich , Neil Horman , "linux-sctp@vger.kernel.org" , LKML Content-Transfer-Encoding: 8BIT Message-Id: <66D9D559-23D6-42B0-9401-62B00C4F748E@lurchi.franken.de> References: <20200621155604.GA23135@minyard.net> <20200622165759.GA3235@minyard.net> <4B68D06C-00F4-42C3-804A-B5531AABCE21@lurchi.franken.de> <20200622183253.GQ2491@localhost.localdomain> <50b0a6ff186e408bbfe6211221cb3998@AcuMS.aculab.com> To: David Laight X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 26. Jun 2020, at 18:13, David Laight wrote: > > From: Xin Long >> Sent: 23 June 2020 11:14 >>>> It looks like a bug to me. Testing with this test app here, I can see >>>> the INIT_ACK being sent with a bunch of ipv4 addresses in it and >>>> that's unexpected for a v6only socket. As is, it's the server saying >>>> "I'm available at these other addresses too, but not." >>> I agree. >> Then we need a fix in sctp_bind_addrs_to_raw(): >> >> @@ -238,6 +240,9 @@ union sctp_params sctp_bind_addrs_to_raw(const >> struct sctp_bind_addr *bp, >> addrparms = retval; >> >> list_for_each_entry(addr, &bp->address_list, list) { >> + if ((PF_INET6 == sk->sk_family) && inet_v6_ipv6only(sk) && >> + (AF_INET == addr->a.sa.sa_family)) >> + continue; >> af = sctp_get_af_specific(addr->a.v4.sin_family); >> len = af->to_addr_param(&addr->a, &rawaddr); >> memcpy(addrparms.v, &rawaddr, len); > > Thought. > > Does it make any sense to offer addresses in the INIT_ACK that don't > have routes to those proposed in the received INIT? > > 'routes' probably isn't exactly the right word. > You probably only want the local address that will be used > as the source address for the probes. > Or, at least, sources addresses that could be used for the probes. > > So if the INIT only contains IPv6 addresses should the INIT_ACK > ever contain IPv4 ones. The client (if it not using an IPv6 socket having IPv6 only enabled) could add an IPv4 address during the lifetime of the association by using the address reconfiguration extension. What could be done is to not send IPv4 addresses if the INIT contains a Supported Address Types parameter indicating IPv6, but not IPv4 support. As a client you might want to send this parameter, when the IPv6 socket has enabled the IPV6_ONLY socket option. Also if the client uses an IPv4 socket, it can indicate in the Supported Address Parameter that it only support IPv4, and the server does not need to list IPv6 addresses. Best regards Michael > > David. > > - > Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK > Registration No: 1397386 (Wales)