From patchwork Fri Aug 28 09:45:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 511840 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D165F14016A for ; Fri, 28 Aug 2015 19:46:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=wJDCUT5u; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751953AbbH1JqG (ORCPT ); Fri, 28 Aug 2015 05:46:06 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:35335 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751648AbbH1JqE (ORCPT ); Fri, 28 Aug 2015 05:46:04 -0400 Received: by pacdd16 with SMTP id dd16so57591163pac.2 for ; Fri, 28 Aug 2015 02:46:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=a3mmfZLYHU1KBp/EIzNfkCFqIQuMQmQGo6Amn7E82V4=; b=wJDCUT5uOALT7REMLsMbia+cpMejSpSC4QrprYzYzkXNmO/4gY4l5z0m8c1fggg7yO iYLFEjoZTy/eGIax8hp0m7+IbE3rA991DsfBEeXOu6r6uEuEWIzvo+lKhA6MU4sHw0Hw 8TPHTJAllSkOTNBF61CrrTpWrhaKxIWshY8lrZRK6VAGGEPfsh+GG64IbMl84lgo2HkC In4H6eZa5rwa2aLjUFewO6Co7cQhwf2EjlpV6x2OwIEnOgTJEU/8Ih9VNuJJmOUCaJO7 aS1iXE38z/NTbm5vOy8GUPU5WAwBLLsEnKoxGK7xQ95JpvwDYhEDtIN7Q/8bG6xH0G9/ CmpA== X-Received: by 10.68.142.130 with SMTP id rw2mr13695759pbb.107.1440755163656; Fri, 28 Aug 2015 02:46:03 -0700 (PDT) Received: from localhost (138.128.208.20.16clouds.com. [138.128.208.20]) by smtp.gmail.com with ESMTPSA id fy6sm5147083pdb.11.2015.08.28.02.46.02 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2015 02:46:03 -0700 (PDT) From: Xin Long To: network dev Cc: mleitner@redhat.com, davem@davemloft.net, vyasevic@redhat.com Subject: [PATCH net v2] sctp: ASCONF-ACK with Unresolvable Address should be sent Date: Fri, 28 Aug 2015 17:45:58 +0800 Message-Id: X-Mailer: git-send-email 2.1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org RFC 5061: This is an opaque integer assigned by the sender to identify each request parameter. The receiver of the ASCONF Chunk will copy this 32-bit value into the ASCONF Response Correlation ID field of the ASCONF-ACK response parameter. The sender of the ASCONF can use this same value in the ASCONF-ACK to find which request the response is for. Note that the receiver MUST NOT change this 32-bit value. Address Parameter: TLV This field contains an IPv4 or IPv6 address parameter, as described in Section 3.3.2.1 of [RFC4960]. ASCONF chunk with Error Cause Indication Parameter (Unresolvable Address) should be sent if the Delete IP Address is not part of the association. Endpoint A Endpoint B (ESTABLISHED) (ESTABLISHED) ASCONF -----------------> (Delete IP Address) <----------------- ASCONF-ACK (Unresolvable Address) Signed-off-by: Xin Long Acked-by: Vlad Yasevich Acked-by: Marcelo Ricardo Leitner --- net/sctp/sm_make_chunk.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 4068fe1..ce7f343 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -3090,8 +3090,19 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc, sctp_assoc_set_primary(asoc, asconf->transport); sctp_assoc_del_nonprimary_peers(asoc, asconf->transport); - } else - sctp_assoc_del_peer(asoc, &addr); + return SCTP_ERROR_NO_ERROR; + } + + /* If the address is not part of the association, the + * ASCONF-ACK with Error Cause Indication Parameter + * which including cause of Unresolvable Address should + * be sent. + */ + peer = sctp_assoc_lookup_paddr(asoc, &addr); + if (!peer) + return SCTP_ERROR_DNS_FAILED; + + sctp_assoc_rm_peer(asoc, peer); break; case SCTP_PARAM_SET_PRIMARY: /* ADDIP Section 4.2.4