From patchwork Fri Apr 14 21:21:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 13211954 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C4CBC77B79 for ; Fri, 14 Apr 2023 21:21:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbjDNVVW (ORCPT ); Fri, 14 Apr 2023 17:21:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjDNVVV (ORCPT ); Fri, 14 Apr 2023 17:21:21 -0400 Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 159A1E52; Fri, 14 Apr 2023 14:21:20 -0700 (PDT) Received: by mail-qt1-x830.google.com with SMTP id bn8so17912969qtb.2; Fri, 14 Apr 2023 14:21:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681507279; x=1684099279; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ez0UQH8rbBx4CTsACR0qZrL7eQpbPtc6iwV9+6O2860=; b=BhQI/GRZYvszKRD2tAVi4IBxluU1ayKSN8kO559+9kXpBQWZevvfurd1juRB96lpww 9wKbXSCMV9Crv7FXKanKY+KHfR+nVJccn3oE9ISK4q0iUqqFPBDH+B8ygsF6B+026wVv /eYoKrhYAB8YSmUOJB0UCXkQiEmu6rZAUKcmQa8h1QVebWjXvjZJLb8vflejk9LAm6Mn FavV4WYqbLntUkHgoDhpReK6KipKU6ecJSPwHNpNvq0OzNihFveybNuJLd6zzLASb8ki lLFcJZAg+WB6JrsRW3851afbp1/LzmkEoVPtxEz8l91MyX64rvkrN0hoRRj3DWOdiXJM jTzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681507279; x=1684099279; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ez0UQH8rbBx4CTsACR0qZrL7eQpbPtc6iwV9+6O2860=; b=kXp8mGyBtA4vWrg9vpBhWgE4F+hbdQ1grbUeE9BM/KWCjJP3l77CK8BSWy+hVGMXoU VNe/ZtOO8Ut/VqWBM+b+GIupewunTtqHqJ2xf0LgPhrONuQki5DzO1Q7Mv3XExpGQpN9 pCwwTs4C19D3PuYuSXv/eo3Yoq3tSsxKoAcDFINNN0tK5aaYACFy4N7TXjGunuCE+4GQ fvq6x8+hYwXT6CaepySBsU56VzXwnCqgNax1BuniXc1acyHPGmzaYboxyJj2wjJI4iL9 ZHNJ7HGuZm99jV/0GLmIRwZpJkJpG3oVb7fN8NWx4bCpQg1nUwaKUiRxuWqLB6pCqMqc leow== X-Gm-Message-State: AAQBX9ftVJ3VbRZWORG30pr2bZoChTgjGwGQNHh0ljA/i4SnXfEe9Wi1 h8j3ZA5ZsHDQCuA+4Z3l65IQXX5KhZBCaQ== X-Google-Smtp-Source: AKy350aAjCNwsezm0vsoe5h6o6hFrnZKIdN8vJmj0vKstFFjbyqqEyvVKjizX/A7cmwUmOZ7rQBZAg== X-Received: by 2002:ac8:7f09:0:b0:3e9:4d19:d9b8 with SMTP id f9-20020ac87f09000000b003e94d19d9b8mr11715380qtk.19.1681507278967; Fri, 14 Apr 2023 14:21:18 -0700 (PDT) Received: from wsfd-netdev15.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id b5-20020ac85bc5000000b003e693d92781sm593373qtb.70.2023.04.14.14.21.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 14:21:18 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, Eric Dumazet , Paolo Abeni , Marcelo Ricardo Leitner Subject: [PATCH net-next 1/2] sctp: delete the obsolete code for the host name address param Date: Fri, 14 Apr 2023 17:21:15 -0400 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org In the latest RFC9260, the Host Name Address param has been deprecated. For INIT chunk: Note 3: An INIT chunk MUST NOT contain the Host Name Address parameter. The receiver of an INIT chunk containing a Host Name Address parameter MUST send an ABORT chunk and MAY include an "Unresolvable Address" error cause. For Supported Address Types: The value indicating the Host Name Address parameter MUST NOT be used when sending this parameter and MUST be ignored when receiving this parameter. Currently Linux SCTP doesn't really support Host Name Address param, but only saves some flag and print debug info, which actually won't even be triggered due to the verification in sctp_verify_param(). This patch is to delete those dead code. Signed-off-by: Xin Long --- include/net/sctp/structs.h | 1 - net/sctp/sm_make_chunk.c | 10 +--------- net/sctp/socket.c | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index a0933efd93c3..070c9458fff4 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -1711,7 +1711,6 @@ struct sctp_association { __u16 ecn_capable:1, /* Can peer do ECN? */ ipv4_address:1, /* Peer understands IPv4 addresses? */ ipv6_address:1, /* Peer understands IPv6 addresses? */ - hostname_address:1, /* Peer understands DNS addresses? */ asconf_capable:1, /* Does peer support ADDIP? */ prsctp_capable:1, /* Can peer do PR-SCTP? */ reconf_capable:1, /* Can peer do RE-CONFIG? */ diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index c7503fd64915..c8f4ec5d5f98 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -2207,7 +2207,7 @@ static enum sctp_ierror sctp_verify_param(struct net *net, break; case SCTP_PARAM_HOST_NAME_ADDRESS: - /* Tell the peer, we won't support this param. */ + /* This param has been Deprecated, send ABORT. */ sctp_process_hn_param(asoc, param, chunk, err_chunk); retval = SCTP_IERROR_ABORT; break; @@ -2589,10 +2589,6 @@ static int sctp_process_param(struct sctp_association *asoc, asoc->cookie_life = ktime_add_ms(asoc->cookie_life, stale); break; - case SCTP_PARAM_HOST_NAME_ADDRESS: - pr_debug("%s: unimplemented SCTP_HOST_NAME_ADDRESS\n", __func__); - break; - case SCTP_PARAM_SUPPORTED_ADDRESS_TYPES: /* Turn off the default values first so we'll know which * ones are really set by the peer. @@ -2624,10 +2620,6 @@ static int sctp_process_param(struct sctp_association *asoc, asoc->peer.ipv6_address = 1; break; - case SCTP_PARAM_HOST_NAME_ADDRESS: - asoc->peer.hostname_address = 1; - break; - default: /* Just ignore anything else. */ break; } diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 218e0982c370..079e726909b4 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -5195,7 +5195,7 @@ int sctp_get_sctp_info(struct sock *sk, struct sctp_association *asoc, mask = asoc->peer.ecn_capable << 1; mask = (mask | asoc->peer.ipv4_address) << 1; mask = (mask | asoc->peer.ipv6_address) << 1; - mask = (mask | asoc->peer.hostname_address) << 1; + mask = mask << 1; mask = (mask | asoc->peer.asconf_capable) << 1; mask = (mask | asoc->peer.prsctp_capable) << 1; mask = (mask | asoc->peer.auth_capable); From patchwork Fri Apr 14 21:21:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 13211956 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F7DCC77B7A for ; Fri, 14 Apr 2023 21:21:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230044AbjDNVVY (ORCPT ); Fri, 14 Apr 2023 17:21:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbjDNVVV (ORCPT ); Fri, 14 Apr 2023 17:21:21 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB4AE1725; Fri, 14 Apr 2023 14:21:20 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id fv6so7372372qtb.9; Fri, 14 Apr 2023 14:21:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681507280; x=1684099280; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oi2O8babklLyox2EN7nagC3RjF+y9LXjfHiQTmAUGuE=; b=ohpRk0N3lsNpBGNje2pJtF8MxynvAz7MvarueFpcN2oYcyYT0SLv03ZVsC5iw1N0zx 4JrMV3/Y6q03e9HIZreASbisTe2aq4MJataYPsTEzcVUKXM7W3ayPtC9+674NEroo9z6 rYvMKc50QizfTxi6OojOGQd/vSyfl8dl0OMrwli8cI824CmrwP2qqEOOxlZ/8WDg9CT4 7TBSoAxVGd143pSVP1yUTTlLarSE1qtzB4ZY2h3A5+vOqkq9jJ/ZIPaCMWmmdf6Pcjj/ VQkF2zhLXRbcIPcdGYx7pG4WXp5D2u7HtGEAJ61IaIhkL1xctxjbAgEyCxMVrQAjSpup f0BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681507280; x=1684099280; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oi2O8babklLyox2EN7nagC3RjF+y9LXjfHiQTmAUGuE=; b=FvpIUztwcHg4NJnj9SR8d3250OamXM4OtnV5anD36UxKX6lD8FSk0XKtHTsPXJrUHM TzlxI5OcgfoviTM6s5AJT+f41mDwrFbKPrC0SyOVcH7vNu+LDuSn2i2pVKrRRNYPK7Tj erHcRF26wRmZ6M/IHy/iuUebVu04dmlJxZ1g1ZyTVyx1jW9u8NyTeqtJgedirqwEOAnT HRwgszhQO9I22jZFleycErTtNySXhUN1JmSRU+iM/a1wPvQl3CDuW4aPIA1xjCXkmdfL gpQLnofEQFGHgmPI/t0bgdObOVp1u3DtI9kiKwFz0LX/RDvJRnqJIeW6ZcR4JJLEgWI6 gtUw== X-Gm-Message-State: AAQBX9cKC/3fAjT+L4BizcPJDojmCXWRLtS6M4dTbm64RjdMkr1g1bhL yny+YKxO71cY5d/s9aUWW6Ois4w+JoPZ/w== X-Google-Smtp-Source: AKy350bMkdREoMYpJAdutNnu3BV7Ik99U9lWhcMT1449xgCx6QX4mNH06/0+YZP0v4AnXQOREtk6Dw== X-Received: by 2002:ac8:5714:0:b0:3bf:d4c3:365d with SMTP id 20-20020ac85714000000b003bfd4c3365dmr11746800qtw.14.1681507279861; Fri, 14 Apr 2023 14:21:19 -0700 (PDT) Received: from wsfd-netdev15.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id b5-20020ac85bc5000000b003e693d92781sm593373qtb.70.2023.04.14.14.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 14:21:19 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, Eric Dumazet , Paolo Abeni , Marcelo Ricardo Leitner Subject: [PATCH net-next 2/2] sctp: add intl_capable and reconf_capable in ss peer_capable Date: Fri, 14 Apr 2023 17:21:16 -0400 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org There are two new peer capables have been added since sctp_diag was introduced into SCTP. When dumping the peer capables, these two new peer capables should also be included. To not break the old capables, reconf_capable takes the old hostname_address bit, and intl_capable uses the higher available bit in sctpi_peer_capable. Signed-off-by: Xin Long --- net/sctp/socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 079e726909b4..cda8c2874691 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -5192,10 +5192,11 @@ int sctp_get_sctp_info(struct sock *sk, struct sctp_association *asoc, info->sctpi_peer_rwnd = asoc->peer.rwnd; info->sctpi_peer_tag = asoc->c.peer_vtag; - mask = asoc->peer.ecn_capable << 1; + mask = asoc->peer.intl_capable << 1; + mask = (mask | asoc->peer.ecn_capable) << 1; mask = (mask | asoc->peer.ipv4_address) << 1; mask = (mask | asoc->peer.ipv6_address) << 1; - mask = mask << 1; + mask = (mask | asoc->peer.reconf_capable) << 1; mask = (mask | asoc->peer.asconf_capable) << 1; mask = (mask | asoc->peer.prsctp_capable) << 1; mask = (mask | asoc->peer.auth_capable);