Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1060375ybm; Wed, 27 May 2020 15:12:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqaYDTBJEpIy6r5kS/sutiNnER9MZ26iG0jAgRAyQfdcQ1otlp+M9ST9S0qnTLJF29vEax X-Received: by 2002:a50:a985:: with SMTP id n5mr261053edc.338.1590617569088; Wed, 27 May 2020 15:12:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590617569; cv=none; d=google.com; s=arc-20160816; b=EYLpG5L99roL/biXGCImso4JjTrrFEr2gBZbg5FPXayHViuvQewiPgtLdyVLzZraHT 9ojaNaP0v7l1T1Bg5FJMygG0J1aGe/WAh1b1GXXR4tsKjy1VP3ZHXJQz+XzReNgkOH3l LgsCZUbkAG8rWRDGjaYIfgcnJcz/Qj6d6VUx0wLaxid0cRfgmAnEZFSadxTDAtkDa5v5 mXuP3daYZiTQEA7t2I5EDshYWA3ki/lnD6Wcu1pnjqg54nRaDOEWfxJvwoGGhC7eLYYD VKiFE58gQah7cAHz2Z2F53O2yHZJ0bPlnR16GHxOSAixcPsQu33xC+nlyEN+2paiRAVk 9+5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=G1XVpETlJJP2/jiBYqi8DO5iH3KbcawIwgPnsLm6SC8=; b=P9fSmkdn4O/fYgT/scYAAfoBCG3FCFN3rBoxWpUbwUZ0ButDUC9eEzFXhkRfQlsqW/ yyeXKYDsSBhB0lHIsdJj9umA12LBli1LPMreBP4FrgUJud+05jUyiu9hjMynNKKisa0M XFW1tH2zZvPoBSDGNtABk5gd98bUKdRD0L1dQklofrxKspt9PJXf8BZ1tDhqqwARQRNQ 4+27zApsZAIhaWT1rUaClOULJHy/FMY02goIGqgUSb4I9EvmUATFYuhnqAONcpc3o9Uq UqDVLCLVdkI9ER3MD72RbgkVridoMBk/C7lKUnw9DMZb+5K3kIJeayzOFZhYEw12uzRp NSHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tp59n4X8; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si2627294ejm.276.2020.05.27.15.12.26; Wed, 27 May 2020 15:12:49 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Tp59n4X8; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726007AbgE0WKk (ORCPT + 99 others); Wed, 27 May 2020 18:10:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbgE0WKj (ORCPT ); Wed, 27 May 2020 18:10:39 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77DA5C05BD1E; Wed, 27 May 2020 15:10:39 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id h9so10434146qtj.7; Wed, 27 May 2020 15:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=G1XVpETlJJP2/jiBYqi8DO5iH3KbcawIwgPnsLm6SC8=; b=Tp59n4X8czCiReNvvETssPFFJvGvIGmo5rc4qluvNzypT/Tkr2LkJFYlrlbkYvGBSz SMKmCostg8pAueCS5/Bey4mSxgdfZcVcg37ZcuvQ+F/yvaQ1Yk7qsRNQpz2c9RHn85bx 0MygTRpTy6xgU4z7fifDIit8ixqEiYh1bUfDfIZTPp4/MOZ7Lmkm4NMbh5Np6AeZlOk2 ftXWKIFgDL4ibrSK28kKyruj+2F6hBBpntD6FMbx1JwEb6fdA2r5x/HhpD2sQBVTcGUm urc73dd/+t0N6gBrMvWpf5fjRaJhgHlda4Q5OX1WqJN9cHDvznyuTUL47hrgNkCgG1us IBsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=G1XVpETlJJP2/jiBYqi8DO5iH3KbcawIwgPnsLm6SC8=; b=VqiaLePLy+N1sXi7As+9KK9gWg7CXXmtl9WQK7oOclUjdP7km527vCpw2/44dSQyDU J7WhVMBi81jAmzYyTxKGFhe4iX6cYE6O5DqI0XxfZ2NHjK0WdIw51EYLczKxdBiJgkoL B25GDv4n8oOdzRa2E96pFAqNOWuq/TVUTWQ9ePlZ/VnUV8Wsr4J+QnzwXsJcvfrS8I7L quS2XtZS3s/vDTBpR5DuMUZWVv5qbvYnF5mhxaU/f+L8w0n/TjWX1FTl2iXHh514eQ50 rCmjm1KMcy2RZGGjKyUWMRAKrNml2pH3+PbZ2QMHew6Prb939MCTYOk64g1D24SMOoAh zCTg== X-Gm-Message-State: AOAM532Yfu21Ke9u3LK7vMVwHYaGDlahTi0k3M2BZ6v2IWcsbdtp1MLy RYSFsgNMB/uBU90TKMgz7d4= X-Received: by 2002:ac8:226d:: with SMTP id p42mr73463qtp.1.1590617438572; Wed, 27 May 2020 15:10:38 -0700 (PDT) Received: from localhost.localdomain ([2001:1284:f013:8992:a39b:b6ab:3df8:5b60]) by smtp.gmail.com with ESMTPSA id i3sm3530811qkf.39.2020.05.27.15.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 15:10:37 -0700 (PDT) Received: by localhost.localdomain (Postfix, from userid 1000) id 6A1E0C1B84; Wed, 27 May 2020 19:10:35 -0300 (-03) Date: Wed, 27 May 2020 19:10:35 -0300 From: Marcelo Ricardo Leitner To: Jonas Falkevik Cc: lucien.xin@gmail.com, nhorman@tuxdriver.com, vyasevich@gmail.com, davem@davemloft.net, kuba@kernel.org, linux-sctp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] sctp: check assoc before SCTP_ADDR_{MADE_PRIM,ADDED} event Message-ID: <20200527221035.GB47547@localhost.localdomain> References: <20200527095640.270986-1-jonas.falkevik@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200527095640.270986-1-jonas.falkevik@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2020 at 11:56:40AM +0200, Jonas Falkevik wrote: > Make sure SCTP_ADDR_{MADE_PRIM,ADDED} are sent only for associations > that have been established. > > These events are described in rfc6458#section-6.1 > SCTP_PEER_ADDR_CHANGE: > This tag indicates that an address that is > part of an existing association has experienced a change of > state (e.g., a failure or return to service of the reachability > of an endpoint via a specific transport address). > > Signed-off-by: Jonas Falkevik Acked-by: Marcelo Ricardo Leitner Thanks! > --- > Changes in v2: > - Check asoc state to be at least established. > Instead of associd being SCTP_FUTURE_ASSOC. > - Common check for all peer addr change event > > net/sctp/ulpevent.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c > index c82dbdcf13f2..77d5c36a8991 100644 > --- a/net/sctp/ulpevent.c > +++ b/net/sctp/ulpevent.c > @@ -343,6 +343,9 @@ void sctp_ulpevent_nofity_peer_addr_change(struct sctp_transport *transport, > struct sockaddr_storage addr; > struct sctp_ulpevent *event; > > + if (asoc->state < SCTP_STATE_ESTABLISHED) > + return; > + > memset(&addr, 0, sizeof(struct sockaddr_storage)); > memcpy(&addr, &transport->ipaddr, transport->af_specific->sockaddr_len); > > -- > 2.25.4 >