Netdev List
 help / color / mirror / Atom feed
From: Vlad Yasevich <vladislav.yasevich@hp.com>
To: lksctp-developers@lists.sourceforge.net
Cc: netdev@vger.kernel.org, Vlad Yasevich <vladislav.yasevich@hp.com>
Subject: [v2 PATCH 8/8] SCTP: Tie ADD-IP and AUTH functionality as required by spec.
Date: Fri, 14 Sep 2007 15:14:50 -0400	[thread overview]
Message-ID: <1189797290519-git-send-email-vladislav.yasevich@hp.com> (raw)
In-Reply-To: <11897955003232-git-send-email-vladislav.yasevich@hp.com>

[.. forgot to refresh the patch, the other version has compile problems ..]

ADD-IP spec requires AUTH. It is, in fact, dangerous without AUTH.
So, disable ADD-IP functionality if the peer claims to support
ADD-IP, but not AUTH.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
---
 include/net/sctp/structs.h |    1 +
 net/sctp/sm_make_chunk.c   |   13 ++++++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 3215da4..a29c59a 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1537,6 +1537,7 @@ struct sctp_association {
 		__u8    asconf_capable;  /* Does peer support ADDIP? */
 		__u8    prsctp_capable;  /* Can peer do PR-SCTP? */
 		__u8	auth_capable;	 /* Is peer doing SCTP-AUTH? */
+		__u8	addip_capable;	 /* Can peer do ADD-IP */
 
 		__u32   adaptation_ind;	 /* Adaptation Code point. */
 
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 7cd8241..5521841 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1851,7 +1851,8 @@ static void sctp_process_ext_param(struct sctp_association *asoc,
 			    break;
 		    case SCTP_CID_ASCONF:
 		    case SCTP_CID_ASCONF_ACK:
-			    /* don't need to do anything for ASCONF */
+			    asoc->peer.addip_capable = 1;
+			    break;
 		    default:
 			    break;
 		}
@@ -2137,6 +2138,16 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid,
 					!asoc->peer.peer_hmacs))
 		asoc->peer.auth_capable = 0;
 
+
+	/* If the peer claims support for ADD-IP without support
+	 * for AUTH, disable support for ADD-IP.
+	 */
+	if (asoc->peer.addip_capable && !asoc->peer.auth_capable) {
+		asoc->peer.addip_disabled_mask |= (SCTP_PARAM_ADD_IP |
+						  SCTP_PARAM_DEL_IP |
+						  SCTP_PARAM_SET_PRIMARY);
+	}
+
 	/* Walk list of transports, removing transports in the UNKNOWN state. */
 	list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
 		transport = list_entry(pos, struct sctp_transport, transports);
-- 
1.5.2.4


  reply	other threads:[~2007-09-14 19:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-14 18:44 [RFC PATCH 0/8] Implement SCTP-AUTH specification Vlad Yasevich
2007-09-14 18:44 ` [PATCH 1/8] SCTP: protocol definitions for SCTP-AUTH implementation Vlad Yasevich
2007-09-17  2:26   ` David Miller
2007-09-14 18:44 ` [PATCH 2/8] SCTP: Implement SCTP-AUTH internals Vlad Yasevich
2007-09-17  2:29   ` David Miller
2007-09-14 18:44 ` [PATCH 3/8] SCTP: Implement SCTP-AUTH initializations Vlad Yasevich
2007-09-17  2:31   ` David Miller
2007-09-14 18:44 ` [PATCH 4/8] SCTP: Implete SCTP-AUTH parameter processing Vlad Yasevich
2007-09-17  2:32   ` David Miller
2007-09-14 18:44 ` [PATCH 5/8] SCTP: Enable the sending of the AUTH chunk Vlad Yasevich
2007-09-17  2:32   ` David Miller
2007-09-14 18:44 ` [PATCH 6/8] SCTP: Implement the receive and verification of " Vlad Yasevich
2007-09-17  2:33   ` David Miller
2007-09-14 18:44 ` [PATCH 7/8] SCTP: API updates to suport SCTP-AUTH extensions Vlad Yasevich
2007-09-17  2:34   ` David Miller
2007-09-14 18:44 ` [PATCH 8/8] SCTP: Tie ADD-IP and AUTH functionality as required by spec Vlad Yasevich
2007-09-14 19:14   ` Vlad Yasevich [this message]
2007-09-17  2:35     ` [v2 PATCH " David Miller
2007-09-17  2:34   ` [PATCH " David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1189797290519-git-send-email-vladislav.yasevich@hp.com \
    --to=vladislav.yasevich@hp.com \
    --cc=lksctp-developers@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox