netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip
@ 2011-04-19  5:07 Wei Yongjun
  2011-04-19  5:09 ` [PATCH net-next-2.6 1/8] sctp: delete unused macro definition of sctp_chunk_is_control Wei Yongjun
                   ` (9 more replies)
  0 siblings, 10 replies; 21+ messages in thread
From: Wei Yongjun @ 2011-04-19  5:07 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp

Series of 8 patches against net-next-2.6, include some cleanup
and tiny fix for add/del ip, which have been waiting on vlad's
lksctp-dev tree for long times.

Shan Wei (5):
      sctp: delete unused macro definition of sctp_chunk_is_control
      sctp: fix the comment of sctp_sf_violation_paramlen()
      sctp: use common head of addr parameter to access member in addr-unrelated code
      sctp: kill abandoned SCTP_CMD_TRANSMIT command
      sctp: use memdup_user to copy data from userspace

Vlad Yasevich (3):
      sctp: teach CACC algorithm about removed transports
      sctp: Allow bindx_del to accept 0 port.
      sctp: Release all routes when processing acks ADD_IP or DEL_IP

 include/net/sctp/command.h   |    1 -
 include/net/sctp/constants.h |    1 -
 net/sctp/input.c             |    2 +-
 net/sctp/outqueue.c          |   11 ++++++++---
 net/sctp/sm_make_chunk.c     |   18 +++++++-----------
 net/sctp/sm_sideeffect.c     |    6 ------
 net/sctp/sm_statefuns.c      |    5 +++--
 net/sctp/socket.c            |   28 +++++++++++-----------------
 8 files changed, 30 insertions(+), 42 deletions(-)



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH net-next-2.6 1/8] sctp: delete unused macro definition of sctp_chunk_is_control
  2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
@ 2011-04-19  5:09 ` Wei Yongjun
  2011-04-19  5:19   ` [PATCH net-next-2.6 1/8 v2] " Wei Yongjun
  2011-04-19  5:11 ` [PATCH net-next-2.6 2/8] sctp: fix the comment of sctp_sf_violation_paramlen() Wei Yongjun
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Wei Yongjun @ 2011-04-19  5:09 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp

The macro never be used.
And if needed, can use !sctp_chunk_is_data instead of.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 include/net/sctp/constants.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index c70d8cc..deac13d 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -150,7 +150,6 @@ SCTP_SUBTYPE_CONSTRUCTOR(OTHER,		sctp_event_other_t,	other)
 SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE,	sctp_event_primitive_t,	primitive)
 
 
-#define sctp_chunk_is_control(a) (a->chunk_hdr->type != SCTP_CID_DATA)
 #define sctp_chunk_is_data(a) (a->chunk_hdr->type == SCTP_CID_DATA)
 
 /* Calculate the actual data size in a data chunk */
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next-2.6 2/8] sctp: fix the comment of sctp_sf_violation_paramlen()
  2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
  2011-04-19  5:09 ` [PATCH net-next-2.6 1/8] sctp: delete unused macro definition of sctp_chunk_is_control Wei Yongjun
@ 2011-04-19  5:11 ` Wei Yongjun
  2011-04-20  4:47   ` David Miller
  2011-04-19  5:11 ` [PATCH net-next-2.6 3/8] sctp: use common head of addr parameter to access member in addr-unrelated code Wei Yongjun
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Wei Yongjun @ 2011-04-19  5:11 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp

From: Shan Wei <shanwei@cn.fujitsu.com>

Update the comment about sctp_sf_violation_paramlen() to be
more precise.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/sm_statefuns.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 7679208..c085472 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -4343,8 +4343,9 @@ static sctp_disposition_t sctp_sf_violation_chunklen(
 
 /*
  * Handle a protocol violation when the parameter length is invalid.
- * "Invalid" length is identified as smaller than the minimal length a
- * given parameter can be.
+ * If the length is smaller than the minimum length of a given parameter,
+ * or accumulated length in multi parameters exceeds the end of the chunk,
+ * the length is considered as invalid.
  */
 static sctp_disposition_t sctp_sf_violation_paramlen(
 				     const struct sctp_endpoint *ep,
-- 
1.6.5.2





^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next-2.6 3/8] sctp: use common head of addr parameter to access member in addr-unrelated code
  2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
  2011-04-19  5:09 ` [PATCH net-next-2.6 1/8] sctp: delete unused macro definition of sctp_chunk_is_control Wei Yongjun
  2011-04-19  5:11 ` [PATCH net-next-2.6 2/8] sctp: fix the comment of sctp_sf_violation_paramlen() Wei Yongjun
@ 2011-04-19  5:11 ` Wei Yongjun
  2011-04-20  4:47   ` David Miller
  2011-04-19  5:12 ` [PATCH net-next-2.6 4/8] sctp: kill abandoned SCTP_CMD_TRANSMIT command Wei Yongjun
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Wei Yongjun @ 2011-04-19  5:11 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp

From: Shan Wei <shanwei@cn.fujitsu.com>

The 'p' member of struct sctp_paramhdr is common part for
IPv4 addr parameter and IPv6 addr parameter in union sctp_addr_param.

For addr-related code, use specified addr parameter.
Otherwise, use common header to access type/length member.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/input.c         |    2 +-
 net/sctp/sm_make_chunk.c |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/sctp/input.c b/net/sctp/input.c
index 5436c69..30cec77 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -1017,7 +1017,7 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
 	/* Skip over the ADDIP header and find the Address parameter */
 	param = (union sctp_addr_param *)(asconf + 1);
 
-	af = sctp_get_af_specific(param_type2af(param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(param->p.type));
 	if (unlikely(!af))
 		return NULL;
 
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index b3434cc..844adfd 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2923,7 +2923,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 	    asconf_param->param_hdr.type != SCTP_PARAM_SET_PRIMARY)
 		return SCTP_ERROR_UNKNOWN_PARAM;
 
-	switch (addr_param->v4.param_hdr.type) {
+	switch (addr_param->p.type) {
 	case SCTP_PARAM_IPV6_ADDRESS:
 		if (!asoc->peer.ipv6_address)
 			return SCTP_ERROR_DNS_FAILED;
@@ -2936,7 +2936,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 		return SCTP_ERROR_DNS_FAILED;
 	}
 
-	af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(addr_param->p.type));
 	if (unlikely(!af))
 		return SCTP_ERROR_DNS_FAILED;
 
@@ -3100,7 +3100,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
 	/* Skip the address parameter and store a pointer to the first
 	 * asconf parameter.
 	 */
-	length = ntohs(addr_param->v4.param_hdr.length);
+	length = ntohs(addr_param->p.length);
 	asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
 	chunk_len -= length;
 
@@ -3177,7 +3177,7 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
 			((void *)asconf_param + sizeof(sctp_addip_param_t));
 
 	/* We have checked the packet before, so we do not check again.	*/
-	af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(addr_param->p.type));
 	af->from_addr_param(&addr, addr_param, htons(bp->port), 0);
 
 	switch (asconf_param->param_hdr.type) {
@@ -3304,7 +3304,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
 	/* Skip the address parameter in the last asconf sent and store a
 	 * pointer to the first asconf parameter.
 	 */
-	length = ntohs(addr_param->v4.param_hdr.length);
+	length = ntohs(addr_param->p.length);
 	asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
 	asconf_len -= length;
 
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next-2.6 4/8] sctp: kill abandoned SCTP_CMD_TRANSMIT command
  2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
                   ` (2 preceding siblings ...)
  2011-04-19  5:11 ` [PATCH net-next-2.6 3/8] sctp: use common head of addr parameter to access member in addr-unrelated code Wei Yongjun
@ 2011-04-19  5:12 ` Wei Yongjun
  2011-04-20  4:47   ` David Miller
  2011-04-19  5:13 ` [PATCH net-next-2.6 5/8] sctp: use memdup_user to copy data from userspace Wei Yongjun
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Wei Yongjun @ 2011-04-19  5:12 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp

From: Shan Wei <shanwei@cn.fujitsu.com>

Remove SCTP_CMD_TRANSMIT command as it never be used.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 include/net/sctp/command.h |    1 -
 net/sctp/sm_sideeffect.c   |    6 ------
 2 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index c01dc99..2b44764 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -73,7 +73,6 @@ typedef enum {
 	SCTP_CMD_INIT_FAILED,   /* High level, do init failure work. */
 	SCTP_CMD_REPORT_DUP,	/* Report a duplicate TSN.  */
 	SCTP_CMD_STRIKE,	/* Mark a strike against a transport.  */
-	SCTP_CMD_TRANSMIT,      /* Transmit the outqueue. */
 	SCTP_CMD_HB_TIMERS_START,    /* Start the heartbeat timers. */
 	SCTP_CMD_HB_TIMER_UPDATE,    /* Update a heartbeat timers.  */
 	SCTP_CMD_HB_TIMERS_STOP,     /* Stop the heartbeat timers.  */
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 5f86ee4..3b80fe2 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1415,12 +1415,6 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
 					SCTP_RTXR_T3_RTX);
 			break;
 
-		case SCTP_CMD_TRANSMIT:
-			/* Kick start transmission. */
-			error = sctp_outq_uncork(&asoc->outqueue);
-			local_cork = 0;
-			break;
-
 		case SCTP_CMD_ECN_CE:
 			/* Do delayed CE processing.   */
 			sctp_do_ecn_ce_work(asoc, cmd->obj.u32);
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next-2.6 5/8] sctp: use memdup_user to copy data from userspace
  2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
                   ` (3 preceding siblings ...)
  2011-04-19  5:12 ` [PATCH net-next-2.6 4/8] sctp: kill abandoned SCTP_CMD_TRANSMIT command Wei Yongjun
@ 2011-04-19  5:13 ` Wei Yongjun
  2011-04-20  4:47   ` David Miller
  2011-04-19  5:13 ` [PATCH net-next-2.6 6/8] sctp: teach CACC algorithm about removed transports Wei Yongjun
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Wei Yongjun @ 2011-04-19  5:13 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp

From: Shan Wei <shanwei@cn.fujitsu.com>

Use common function to simply code.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/socket.c |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index deb82e3..5c9980a 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3215,14 +3215,9 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk,
 	if (optlen < sizeof(struct sctp_hmacalgo))
 		return -EINVAL;
 
-	hmacs = kmalloc(optlen, GFP_KERNEL);
-	if (!hmacs)
-		return -ENOMEM;
-
-	if (copy_from_user(hmacs, optval, optlen)) {
-		err = -EFAULT;
-		goto out;
-	}
+	hmacs= memdup_user(optval, optlen);
+	if (IS_ERR(hmacs))
+		return PTR_ERR(hmacs);
 
 	idents = hmacs->shmac_num_idents;
 	if (idents == 0 || idents > SCTP_AUTH_NUM_HMACS ||
@@ -3257,14 +3252,9 @@ static int sctp_setsockopt_auth_key(struct sock *sk,
 	if (optlen <= sizeof(struct sctp_authkey))
 		return -EINVAL;
 
-	authkey = kmalloc(optlen, GFP_KERNEL);
-	if (!authkey)
-		return -ENOMEM;
-
-	if (copy_from_user(authkey, optval, optlen)) {
-		ret = -EFAULT;
-		goto out;
-	}
+	authkey= memdup_user(optval, optlen);
+	if (IS_ERR(authkey))
+		return PTR_ERR(authkey);
 
 	if (authkey->sca_keylength > optlen - sizeof(struct sctp_authkey)) {
 		ret = -EINVAL;
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next-2.6 6/8] sctp: teach CACC algorithm about removed transports
  2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
                   ` (4 preceding siblings ...)
  2011-04-19  5:13 ` [PATCH net-next-2.6 5/8] sctp: use memdup_user to copy data from userspace Wei Yongjun
@ 2011-04-19  5:13 ` Wei Yongjun
  2011-04-20  4:47   ` David Miller
  2011-04-19  5:14 ` [PATCH net-next-2.6 7/8] sctp: Allow bindx_del to accept 0 port Wei Yongjun
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Wei Yongjun @ 2011-04-19  5:13 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp

From: Vlad Yasevich <vladislav.yasevich@hp.com>

When we have have to remove a transport due to ASCONF, we move
the data to a new active path.  This can trigger CACC algorithm
to not mark that data as missing when SACKs arrive.  This is
because the transport passed to the CACC algorithm is the one
this data is sitting on, not the one it was sent on (that one
may be gone).  So, by sending the original transport (even if
it's NULL), we may start marking data as missing.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/outqueue.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index bf92a5b..7812772 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -131,7 +131,8 @@ static inline int sctp_cacc_skip_3_1_d(struct sctp_transport *primary,
 static inline int sctp_cacc_skip_3_1_f(struct sctp_transport *transport,
 				       int count_of_newacks)
 {
-	if (count_of_newacks < 2 && !transport->cacc.cacc_saw_newack)
+	if (count_of_newacks < 2 &&
+			(transport && !transport->cacc.cacc_saw_newack))
 		return 1;
 	return 0;
 }
@@ -618,9 +619,12 @@ redo:
 
 			/* If we are retransmitting, we should only
 			 * send a single packet.
+			 * Otherwise, try appending this chunk again.
 			 */
 			if (rtx_timeout || fast_rtx)
 				done = 1;
+			else
+				goto redo;
 
 			/* Bundle next chunk in the next round.  */
 			break;
@@ -1683,8 +1687,9 @@ static void sctp_mark_missing(struct sctp_outq *q,
 			/* SFR-CACC may require us to skip marking
 			 * this chunk as missing.
 			 */
-			if (!transport || !sctp_cacc_skip(primary, transport,
-					    count_of_newacks, tsn)) {
+			if (!transport || !sctp_cacc_skip(primary,
+						chunk->transport,
+						count_of_newacks, tsn)) {
 				chunk->tsn_missing_report++;
 
 				SCTP_DEBUG_PRINTK(
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next-2.6 7/8] sctp: Allow bindx_del to accept 0 port
  2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
                   ` (5 preceding siblings ...)
  2011-04-19  5:13 ` [PATCH net-next-2.6 6/8] sctp: teach CACC algorithm about removed transports Wei Yongjun
@ 2011-04-19  5:14 ` Wei Yongjun
  2011-04-20  4:47   ` David Miller
  2011-04-19  5:15 ` [PATCH net-next-2.6 8/8] sctp: Release all routes when processing acks ADD_IP or DEL_IP Wei Yongjun
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 21+ messages in thread
From: Wei Yongjun @ 2011-04-19  5:14 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp

From: Vlad Yasevich <vladislav.yasevich@hp.com>

We allow 0 port when adding new addresses.  It only
makes sence to allow 0 port when removing addresses.
When removing the currently bound port will be used
when the port in the address is set to 0.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/socket.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 5c9980a..431b890 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -658,11 +658,15 @@ static int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt)
 			goto err_bindx_rem;
 		}
 
-		if (sa_addr->v4.sin_port != htons(bp->port)) {
+		if (sa_addr->v4.sin_port &&
+		    sa_addr->v4.sin_port != htons(bp->port)) {
 			retval = -EINVAL;
 			goto err_bindx_rem;
 		}
 
+		if (!sa_addr->v4.sin_port)
+			sa_addr->v4.sin_port = htons(bp->port);
+
 		/* FIXME - There is probably a need to check if sk->sk_saddr and
 		 * sk->sk_rcv_addr are currently set to one of the addresses to
 		 * be removed. This is something which needs to be looked into
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next-2.6 8/8] sctp: Release all routes when processing acks ADD_IP or DEL_IP
  2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
                   ` (6 preceding siblings ...)
  2011-04-19  5:14 ` [PATCH net-next-2.6 7/8] sctp: Allow bindx_del to accept 0 port Wei Yongjun
@ 2011-04-19  5:15 ` Wei Yongjun
  2011-04-20  4:47   ` David Miller
  2011-04-19  5:31 ` [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Shan Wei
  2011-04-19  8:10 ` Nicolas Dichtel
  9 siblings, 1 reply; 21+ messages in thread
From: Wei Yongjun @ 2011-04-19  5:15 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp

From: Vlad Yasevich <vladislav.yasevich@hp.com>

When processing an ACK for ADD_IP parameter, we only release
the routes on non-active transports.  This can cause a wrong
source address to be used.  We can release the routes and
cause new route lookups and source address selection so that
new addresses can be used as source.  Additionally, we don't need
to lookup routes for all transports at the same time.  We can let
the transmit code path update the cached route when the transport
actually sends something.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/sm_make_chunk.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 844adfd..f87ccb1 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3193,11 +3193,8 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
 		local_bh_enable();
 		list_for_each_entry(transport, &asoc->peer.transport_addr_list,
 				transports) {
-			if (transport->state == SCTP_ACTIVE)
-				continue;
 			dst_release(transport->dst);
-			sctp_transport_route(transport, NULL,
-					     sctp_sk(asoc->base.sk));
+			transport->dst = NULL;
 		}
 		break;
 	case SCTP_PARAM_DEL_IP:
@@ -3207,8 +3204,7 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
 		list_for_each_entry(transport, &asoc->peer.transport_addr_list,
 				transports) {
 			dst_release(transport->dst);
-			sctp_transport_route(transport, NULL,
-					     sctp_sk(asoc->base.sk));
+			transport->dst = NULL;
 		}
 		break;
 	default:
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH net-next-2.6 1/8 v2] sctp: delete unused macro definition of sctp_chunk_is_control
  2011-04-19  5:09 ` [PATCH net-next-2.6 1/8] sctp: delete unused macro definition of sctp_chunk_is_control Wei Yongjun
@ 2011-04-19  5:19   ` Wei Yongjun
  2011-04-20  4:47     ` David Miller
  0 siblings, 1 reply; 21+ messages in thread
From: Wei Yongjun @ 2011-04-19  5:19 UTC (permalink / raw)
  To: David Miller; +Cc: netdev@vger.kernel.org, lksctp

From: Shan Wei <shanwei@cn.fujitsu.com>

The macro never be used.
And if needed, can use !sctp_chunk_is_data instead of.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
Sorry for missing 'From ...' in the first version
---
 include/net/sctp/constants.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index c70d8cc..deac13d 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -150,7 +150,6 @@ SCTP_SUBTYPE_CONSTRUCTOR(OTHER,		sctp_event_other_t,	other)
 SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE,	sctp_event_primitive_t,	primitive)
 
 
-#define sctp_chunk_is_control(a) (a->chunk_hdr->type != SCTP_CID_DATA)
 #define sctp_chunk_is_data(a) (a->chunk_hdr->type == SCTP_CID_DATA)
 
 /* Calculate the actual data size in a data chunk */
-- 
1.6.5.2



^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip
  2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
                   ` (7 preceding siblings ...)
  2011-04-19  5:15 ` [PATCH net-next-2.6 8/8] sctp: Release all routes when processing acks ADD_IP or DEL_IP Wei Yongjun
@ 2011-04-19  5:31 ` Shan Wei
  2011-04-19  8:10 ` Nicolas Dichtel
  9 siblings, 0 replies; 21+ messages in thread
From: Shan Wei @ 2011-04-19  5:31 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: David Miller, netdev@vger.kernel.org, lksctp

Wei Yongjun wrote, at 04/19/2011 01:07 PM:
> Series of 8 patches against net-next-2.6, include some cleanup
> and tiny fix for add/del ip, which have been waiting on vlad's
> lksctp-dev tree for long times.

Thanks for your job, and expect others.

> 
> Shan Wei (5):
>       sctp: delete unused macro definition of sctp_chunk_is_control
>       sctp: fix the comment of sctp_sf_violation_paramlen()
>       sctp: use common head of addr parameter to access member in addr-unrelated code
>       sctp: kill abandoned SCTP_CMD_TRANSMIT command
>       sctp: use memdup_user to copy data from userspace
> 
> Vlad Yasevich (3):
>       sctp: teach CACC algorithm about removed transports
>       sctp: Allow bindx_del to accept 0 port.
>       sctp: Release all routes when processing acks ADD_IP or DEL_IP
> 
>  include/net/sctp/command.h   |    1 -
>  include/net/sctp/constants.h |    1 -
>  net/sctp/input.c             |    2 +-
>  net/sctp/outqueue.c          |   11 ++++++++---
>  net/sctp/sm_make_chunk.c     |   18 +++++++-----------
>  net/sctp/sm_sideeffect.c     |    6 ------
>  net/sctp/sm_statefuns.c      |    5 +++--
>  net/sctp/socket.c            |   28 +++++++++++-----------------
>  8 files changed, 30 insertions(+), 42 deletions(-)
> 
 
-- 
Best Regards
-----
Shan Wei

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip
  2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
                   ` (8 preceding siblings ...)
  2011-04-19  5:31 ` [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Shan Wei
@ 2011-04-19  8:10 ` Nicolas Dichtel
  2011-04-19  8:18   ` Wei Yongjun
  9 siblings, 1 reply; 21+ messages in thread
From: Nicolas Dichtel @ 2011-04-19  8:10 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: David Miller, netdev@vger.kernel.org, lksctp

Hi Wei Yongjun,

do you plan to send other patches, like "sctp: make sctp over IPv6 work with 
IPsec.", too?


Regards,
Nicolas

Le 19/04/2011 07:07, Wei Yongjun a écrit :
> Series of 8 patches against net-next-2.6, include some cleanup
> and tiny fix for add/del ip, which have been waiting on vlad's
> lksctp-dev tree for long times.
>
> Shan Wei (5):
>        sctp: delete unused macro definition of sctp_chunk_is_control
>        sctp: fix the comment of sctp_sf_violation_paramlen()
>        sctp: use common head of addr parameter to access member in addr-unrelated code
>        sctp: kill abandoned SCTP_CMD_TRANSMIT command
>        sctp: use memdup_user to copy data from userspace
>
> Vlad Yasevich (3):
>        sctp: teach CACC algorithm about removed transports
>        sctp: Allow bindx_del to accept 0 port.
>        sctp: Release all routes when processing acks ADD_IP or DEL_IP
>
>   include/net/sctp/command.h   |    1 -
>   include/net/sctp/constants.h |    1 -
>   net/sctp/input.c             |    2 +-
>   net/sctp/outqueue.c          |   11 ++++++++---
>   net/sctp/sm_make_chunk.c     |   18 +++++++-----------
>   net/sctp/sm_sideeffect.c     |    6 ------
>   net/sctp/sm_statefuns.c      |    5 +++--
>   net/sctp/socket.c            |   28 +++++++++++-----------------
>   8 files changed, 30 insertions(+), 42 deletions(-)
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip
  2011-04-19  8:10 ` Nicolas Dichtel
@ 2011-04-19  8:18   ` Wei Yongjun
  0 siblings, 0 replies; 21+ messages in thread
From: Wei Yongjun @ 2011-04-19  8:18 UTC (permalink / raw)
  To: nicolas.dichtel; +Cc: David Miller, netdev@vger.kernel.org, lksctp



> Hi Wei Yongjun,
>
> do you plan to send other patches, like "sctp: make sctp over IPv6 work with IPsec.", too?

Yes, I am doing this work now. And will commit those patch after backport
to net-next-2.6 tree and testing.

>
>
> Regards,
> Nicolas
>
> Le 19/04/2011 07:07, Wei Yongjun a écrit :
>> Series of 8 patches against net-next-2.6, include some cleanup
>> and tiny fix for add/del ip, which have been waiting on vlad's
>> lksctp-dev tree for long times.
>>
>> Shan Wei (5):
>>        sctp: delete unused macro definition of sctp_chunk_is_control
>>        sctp: fix the comment of sctp_sf_violation_paramlen()
>>        sctp: use common head of addr parameter to access member in addr-unrelated code
>>        sctp: kill abandoned SCTP_CMD_TRANSMIT command
>>        sctp: use memdup_user to copy data from userspace
>>
>> Vlad Yasevich (3):
>>        sctp: teach CACC algorithm about removed transports
>>        sctp: Allow bindx_del to accept 0 port.
>>        sctp: Release all routes when processing acks ADD_IP or DEL_IP
>>
>>   include/net/sctp/command.h   |    1 -
>>   include/net/sctp/constants.h |    1 -
>>   net/sctp/input.c             |    2 +-
>>   net/sctp/outqueue.c          |   11 ++++++++---
>>   net/sctp/sm_make_chunk.c     |   18 +++++++-----------
>>   net/sctp/sm_sideeffect.c     |    6 ------
>>   net/sctp/sm_statefuns.c      |    5 +++--
>>   net/sctp/socket.c            |   28 +++++++++++-----------------
>>   8 files changed, 30 insertions(+), 42 deletions(-)
>>
>>
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> -- 
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next-2.6 1/8 v2] sctp: delete unused macro definition of sctp_chunk_is_control
  2011-04-19  5:19   ` [PATCH net-next-2.6 1/8 v2] " Wei Yongjun
@ 2011-04-20  4:47     ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2011-04-20  4:47 UTC (permalink / raw)
  To: yjwei; +Cc: netdev, linux-sctp

From: Wei Yongjun <yjwei@cn.fujitsu.com>
Date: Tue, 19 Apr 2011 13:19:29 +0800

> From: Shan Wei <shanwei@cn.fujitsu.com>
> 
> The macro never be used.
> And if needed, can use !sctp_chunk_is_data instead of.
> 
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next-2.6 2/8] sctp: fix the comment of sctp_sf_violation_paramlen()
  2011-04-19  5:11 ` [PATCH net-next-2.6 2/8] sctp: fix the comment of sctp_sf_violation_paramlen() Wei Yongjun
@ 2011-04-20  4:47   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2011-04-20  4:47 UTC (permalink / raw)
  To: yjwei; +Cc: netdev, linux-sctp

From: Wei Yongjun <yjwei@cn.fujitsu.com>
Date: Tue, 19 Apr 2011 13:11:01 +0800

> From: Shan Wei <shanwei@cn.fujitsu.com>
> 
> Update the comment about sctp_sf_violation_paramlen() to be
> more precise.
> 
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next-2.6 3/8] sctp: use common head of addr parameter to access member in addr-unrelated code
  2011-04-19  5:11 ` [PATCH net-next-2.6 3/8] sctp: use common head of addr parameter to access member in addr-unrelated code Wei Yongjun
@ 2011-04-20  4:47   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2011-04-20  4:47 UTC (permalink / raw)
  To: yjwei; +Cc: netdev, linux-sctp

From: Wei Yongjun <yjwei@cn.fujitsu.com>
Date: Tue, 19 Apr 2011 13:11:47 +0800

> From: Shan Wei <shanwei@cn.fujitsu.com>
> 
> The 'p' member of struct sctp_paramhdr is common part for
> IPv4 addr parameter and IPv6 addr parameter in union sctp_addr_param.
> 
> For addr-related code, use specified addr parameter.
> Otherwise, use common header to access type/length member.
> 
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next-2.6 4/8] sctp: kill abandoned SCTP_CMD_TRANSMIT command
  2011-04-19  5:12 ` [PATCH net-next-2.6 4/8] sctp: kill abandoned SCTP_CMD_TRANSMIT command Wei Yongjun
@ 2011-04-20  4:47   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2011-04-20  4:47 UTC (permalink / raw)
  To: yjwei; +Cc: netdev, linux-sctp

From: Wei Yongjun <yjwei@cn.fujitsu.com>
Date: Tue, 19 Apr 2011 13:12:40 +0800

> From: Shan Wei <shanwei@cn.fujitsu.com>
> 
> Remove SCTP_CMD_TRANSMIT command as it never be used.
> 
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next-2.6 5/8] sctp: use memdup_user to copy data from userspace
  2011-04-19  5:13 ` [PATCH net-next-2.6 5/8] sctp: use memdup_user to copy data from userspace Wei Yongjun
@ 2011-04-20  4:47   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2011-04-20  4:47 UTC (permalink / raw)
  To: yjwei; +Cc: netdev, linux-sctp

From: Wei Yongjun <yjwei@cn.fujitsu.com>
Date: Tue, 19 Apr 2011 13:13:18 +0800

> From: Shan Wei <shanwei@cn.fujitsu.com>
> 
> Use common function to simply code.
> 
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next-2.6 6/8] sctp: teach CACC algorithm about removed transports
  2011-04-19  5:13 ` [PATCH net-next-2.6 6/8] sctp: teach CACC algorithm about removed transports Wei Yongjun
@ 2011-04-20  4:47   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2011-04-20  4:47 UTC (permalink / raw)
  To: yjwei; +Cc: netdev, linux-sctp

From: Wei Yongjun <yjwei@cn.fujitsu.com>
Date: Tue, 19 Apr 2011 13:13:56 +0800

> From: Vlad Yasevich <vladislav.yasevich@hp.com>
> 
> When we have have to remove a transport due to ASCONF, we move
> the data to a new active path.  This can trigger CACC algorithm
> to not mark that data as missing when SACKs arrive.  This is
> because the transport passed to the CACC algorithm is the one
> this data is sitting on, not the one it was sent on (that one
> may be gone).  So, by sending the original transport (even if
> it's NULL), we may start marking data as missing.
> 
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next-2.6 7/8] sctp: Allow bindx_del to accept 0 port
  2011-04-19  5:14 ` [PATCH net-next-2.6 7/8] sctp: Allow bindx_del to accept 0 port Wei Yongjun
@ 2011-04-20  4:47   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2011-04-20  4:47 UTC (permalink / raw)
  To: yjwei; +Cc: netdev, linux-sctp

From: Wei Yongjun <yjwei@cn.fujitsu.com>
Date: Tue, 19 Apr 2011 13:14:47 +0800

> From: Vlad Yasevich <vladislav.yasevich@hp.com>
> 
> We allow 0 port when adding new addresses.  It only
> makes sence to allow 0 port when removing addresses.
> When removing the currently bound port will be used
> when the port in the address is set to 0.
> 
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH net-next-2.6 8/8] sctp: Release all routes when processing acks ADD_IP or DEL_IP
  2011-04-19  5:15 ` [PATCH net-next-2.6 8/8] sctp: Release all routes when processing acks ADD_IP or DEL_IP Wei Yongjun
@ 2011-04-20  4:47   ` David Miller
  0 siblings, 0 replies; 21+ messages in thread
From: David Miller @ 2011-04-20  4:47 UTC (permalink / raw)
  To: yjwei; +Cc: netdev, linux-sctp

From: Wei Yongjun <yjwei@cn.fujitsu.com>
Date: Tue, 19 Apr 2011 13:15:22 +0800

> From: Vlad Yasevich <vladislav.yasevich@hp.com>
> 
> When processing an ACK for ADD_IP parameter, we only release
> the routes on non-active transports.  This can cause a wrong
> source address to be used.  We can release the routes and
> cause new route lookups and source address selection so that
> new addresses can be used as source.  Additionally, we don't need
> to lookup routes for all transports at the same time.  We can let
> the transmit code path update the cached route when the transport
> actually sends something.
> 
> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>

Applied.

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2011-04-20  4:48 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
2011-04-19  5:09 ` [PATCH net-next-2.6 1/8] sctp: delete unused macro definition of sctp_chunk_is_control Wei Yongjun
2011-04-19  5:19   ` [PATCH net-next-2.6 1/8 v2] " Wei Yongjun
2011-04-20  4:47     ` David Miller
2011-04-19  5:11 ` [PATCH net-next-2.6 2/8] sctp: fix the comment of sctp_sf_violation_paramlen() Wei Yongjun
2011-04-20  4:47   ` David Miller
2011-04-19  5:11 ` [PATCH net-next-2.6 3/8] sctp: use common head of addr parameter to access member in addr-unrelated code Wei Yongjun
2011-04-20  4:47   ` David Miller
2011-04-19  5:12 ` [PATCH net-next-2.6 4/8] sctp: kill abandoned SCTP_CMD_TRANSMIT command Wei Yongjun
2011-04-20  4:47   ` David Miller
2011-04-19  5:13 ` [PATCH net-next-2.6 5/8] sctp: use memdup_user to copy data from userspace Wei Yongjun
2011-04-20  4:47   ` David Miller
2011-04-19  5:13 ` [PATCH net-next-2.6 6/8] sctp: teach CACC algorithm about removed transports Wei Yongjun
2011-04-20  4:47   ` David Miller
2011-04-19  5:14 ` [PATCH net-next-2.6 7/8] sctp: Allow bindx_del to accept 0 port Wei Yongjun
2011-04-20  4:47   ` David Miller
2011-04-19  5:15 ` [PATCH net-next-2.6 8/8] sctp: Release all routes when processing acks ADD_IP or DEL_IP Wei Yongjun
2011-04-20  4:47   ` David Miller
2011-04-19  5:31 ` [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Shan Wei
2011-04-19  8:10 ` Nicolas Dichtel
2011-04-19  8:18   ` Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).