[PATCH v2] sctp: Fix sk_ack_backlog wrap-around problem

2014-06-11 Thread Xufeng Zhang
afterward in the same socket, ABORT would be triggered since sctp deem the accept queue as full. Fix this issue by only decrementing sk_ack_backlog for associations in the endpoint's list. Fix-suggested-by: Neil Horman Signed-off-by: Xufeng Zhang --- Change for v2: Drop the redundant tes

Re: [PATCH] sctp: Fix sk_ack_backlog wrap-around problem

2014-06-11 Thread Xufeng Zhang
On 06/12/2014 12:55 AM, Vlad Yasevich wrote: On 06/11/2014 08:55 AM, Vlad Yasevich wrote: On 06/10/2014 10:37 PM, Xufeng Zhang wrote: Consider the scenario: For a TCP-style socket, while processing the COOKIE_ECHO chunk in sctp_sf_do_5_1D_ce(), after it has passed a series of sanity

[PATCH] sctp: Fix sk_ack_backlog wrap-around problem

2014-06-10 Thread Xufeng Zhang
afterward in the same socket, ABORT would be triggered since sctp deem the accept queue as full. Fix this issue by only decrementing sk_ack_backlog for associations in the endpoint's list. Fix-suggested-by: Neil Horman Signed-off-by: Xufeng Zhang --- net/sctp/associola.c |2 +- 1

sctp bug: sk_ack_backlog wrap-around problem

2014-06-09 Thread Xufeng Zhang
Hi Vlad and Neil, I found a sk_ack_backlog wrap-around problem during handling received COOKIE_ECHO. Consider the scenario: For a TCP-style socket, while processing the COOKIE_ECHO chunk in sctp_sf_do_5_1D_ce(), after it has passed a series of sanity check, a new association would be created in s

Re: [RFC][PATCH] af_key: return error when meet errors on sendmsg() syscall

2014-05-11 Thread Xufeng Zhang
On 05/12/2014 01:11 PM, David Miller wrote: So it makes sense to return errors for send() syscall. Signed-off-by: Xufeng Zhang I disagree. If pfkey_error() is successful, the error will be reported in the AF_KEY message that is broadcast, there is no reason for sendmsg to return an

[RFC][PATCH] af_key: return error when meet errors on sendmsg() syscall

2014-05-08 Thread Xufeng Zhang
send() syscall. Signed-off-by: Xufeng Zhang --- net/key/af_key.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/key/af_key.c b/net/key/af_key.c index f3c8307..9e4bc8c 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c @@ -335,7 +335,7 @@ static int pfkey_err

[PATCH V2] sctp: reset flowi4_oif parameter on route lookup

2014-04-25 Thread Xufeng Zhang
ute add table 4 default via 10.0.0.254 src 10.0.0.14 dev eth0.3 # sctp_darn -H 10.0.0.14 -P 36422 -h 10.1.4.134 -p 36422 -s -I You'll detect that all the flow are routed to eth0.2(10.0.1.254). Signed-off-by: Xufeng Zhang Signed-off-by: Julian Anastasov --- Changelog: v1->v2: Sugges

Re: [PATCH] sctp: reset flowi4_oif parameter on route lookup

2014-04-25 Thread Xufeng Zhang
On 04/25/2014 03:57 PM, Julian Anastasov wrote: Hello, On Fri, 25 Apr 2014, Xufeng Zhang wrote: diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index c09757f..f8a5968 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -493,6 +493,10 @@ static void

[PATCH] sctp: reset flowi4_oif parameter on route lookup

2014-04-25 Thread Xufeng Zhang
ute add table 4 default via 10.0.0.254 src 10.0.0.14 dev eth0.3 # sctp_darn -H 10.0.0.14 -P 36422 -h 10.1.4.134 -p 36422 -s -I You'll detect that all the flow are routed to eth0.2(10.0.1.254). Signed-off-by: Xufeng Zhang --- net/sctp/protocol.c |4 1 files changed, 4 insertions(+),

[PATCH RFC] sctp: Update HEARTBEAT timer immediately after user changed HB.interval

2014-02-17 Thread Xufeng Zhang
meet the requirement of the user who need to get HEARTBEAT sent at the specified time. Thus, we need to update the heartbeat timer immediately after user has changed HB.interval. Signed-off-by: Xufeng Zhang --- net/sctp/socket.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff

[V2 PATCH] sctp: Restore 'resent' bit to avoid retransmitted chunks for RTT measurements

2013-11-24 Thread Xufeng Zhang
hich inappropriately removed the 'resent' bit completely, instead of doing this, we should set the resent bit only for the retransmitted DATA chunks. Signed-off-by: Xufeng Zhang --- v1->v2: Rmoved initialization for resent bit. Combined two if clause include/net/sctp/stru

Re: [PATCH] sctp: Restore 'resent' bit to avoid retransmitted chunks for RTT measurements

2013-11-24 Thread Xufeng Zhang
On 11/22/2013 10:18 PM, Vlad Yasevich wrote: On 11/22/2013 03:30 AM, Xufeng Zhang wrote: From: Signed-off-by: Xufeng Zhang Currently retransmitted DATA chunks could also be used for RTT measurements since there are no flag to identify whether the transmitted DATA chunk is a new one or a

[PATCH] sctp: Restore 'resent' bit to avoid retransmitted chunks for RTT measurements

2013-11-22 Thread Xufeng Zhang
From: Signed-off-by: Xufeng Zhang Currently retransmitted DATA chunks could also be used for RTT measurements since there are no flag to identify whether the transmitted DATA chunk is a new one or a retransmitted one. This problem is introduced by commit ae19c5486 ("sctp: remove 'r

Re: [PATCH] sctp: set association state to established in dupcook_a handler

2013-06-07 Thread Xufeng Zhang
Hi David, Is this fix fine to you for -stable? Thanks, Xufeng On 06/05/2013 10:55 AM, Xufeng Zhang wrote: On 06/03/2013 03:52 PM, Xufeng Zhang wrote: 3.4-stable review patch. If anyone has any objections, please let me know. Sorry Greg, David -- I did not fully understand all the details

Re: [PATCH] sctp: set association state to established in dupcook_a handler

2013-06-04 Thread Xufeng Zhang
On 06/03/2013 03:52 PM, Xufeng Zhang wrote: 3.4-stable review patch. If anyone has any objections, please let me know. Sorry Greg, David -- I did not fully understand all the details of the stable kernel process earlier. I have since checked the networking stable queue here: http

Re: [PATCH] sctp: set association state to established in dupcook_a handler

2013-06-04 Thread Xufeng Zhang
On 06/05/2013 08:13 AM, Ben Hutchings wrote: On Tue, 2013-06-04 at 10:00 +0800, Xufeng Zhang wrote: On 06/03/2013 10:28 PM, Greg KH wrote: On Mon, Jun 03, 2013 at 03:52:58PM +0800, Xufeng Zhang wrote: 3.4-stable review patch. If anyone has any objections, please let me

Re: [PATCH] sctp: set association state to established in dupcook_a handler

2013-06-03 Thread Xufeng Zhang
On 06/03/2013 10:28 PM, Greg KH wrote: On Mon, Jun 03, 2013 at 03:52:58PM +0800, Xufeng Zhang wrote: 3.4-stable review patch. If anyone has any objections, please let me know. Really? What are you going to do with it if no one objects? Sorry, I don't have any experience

[PATCH] sctp: set association state to established in dupcook_a handler

2013-06-03 Thread Xufeng Zhang
3.4-stable review patch. If anyone has any objections, please let me know. -- From: Xufeng Zhang [ Upstream commit 9839ff0dead906e85e4d17490aeff87a5859a157 ] While sctp handling a duplicate COOKIE-ECHO and the action is 'Association restart', sctp_sf_do_dupcoo

Re: [PATCH] sctp: don't break the loop while meeting the active_path so as to find the matched transport

2013-03-11 Thread Xufeng Zhang
>> >> Thanks for your review, Neil! >> >> I know what you mean, yes, it's most probably that the searched TSN was >> transmitted in the currently active_path, but what should we do if not. >> >> Check the comment in sctp_assoc_lookup_tsn() function: >> /* Let's be hopeful and check the active_path

Re: [PATCH] sctp: don't break the loop while meeting the active_path so as to find the matched transport

2013-03-10 Thread Xufeng Zhang
On 3/8/13, Neil Horman wrote: > On Fri, Mar 08, 2013 at 03:39:37PM +0800, Xufeng Zhang wrote: >> sctp_assoc_lookup_tsn() function searchs which transport a certain TSN >> was sent on, if not found in the active_path transport, then go search >> all the other tra

[PATCH] sctp: don't break the loop while meeting the active_path so as to find the matched transport

2013-03-07 Thread Xufeng Zhang
t the active_path transport. Signed-off-by: Xufeng Zhang --- net/sctp/associola.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 43cd0dd..d2709e2 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -1079,7 +1079,7 @@ s

Re: [PATCH] sctp: set association state to established in dupcook_a handler

2013-01-23 Thread Xufeng Zhang
On 1/23/13, Vlad Yasevich wrote: > On 01/23/2013 08:46 AM, Neil Horman wrote: >> On Wed, Jan 23, 2013 at 03:38:40PM +0800, xufengzhang.m...@gmail.com >> wrote: >>> From: Xufeng Zhang >>> >>> While sctp handling a duplicate COOKIE-ECHO

Re: [PATCH] sctp: set association state to established in dupcook_a handler

2013-01-23 Thread Xufeng Zhang
On 1/23/13, Neil Horman wrote: > On Wed, Jan 23, 2013 at 03:38:40PM +0800, xufengzhang.m...@gmail.com wrote: >> From: Xufeng Zhang >> >> While sctp handling a duplicate COOKIE-ECHO and the action is >> 'Association restart', sctp_sf_do_dupcook_a() will pro

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-08-02 Thread xufeng zhang
On 08/03/2012 05:17 AM, Vlad Yasevich wrote: On 07/31/2012 02:51 AM, xufeng zhang wrote: Sorry, please ignore the above patch, there was an paste error. Please check the following patch. I'm wondering if the below solution is fine to you whi

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-30 Thread xufeng zhang
ation, but only one problem persists: there is a potential that commands will exceeds SCTP_MAX_NUM_COMMANDS which happens during sending lots of small error DATA chunks. Thanks, Xufeng Zhang --- include/net/sctp/command.h |1 + include/net/sctp/structs.h |3 +++ net/sctp/outqueue.c|

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-30 Thread Xufeng Zhang
small error DATA chunks. Thanks, Xufeng Zhang --- diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 712b3be..62c34f5 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h @@ -110,6 +110,7 @@ typedef enum { SCTP_CMD_SEND_NEXT_ASCONF, /* Send the

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-29 Thread Xufeng Zhang
On 7/30/12, Xufeng Zhang wrote: > On 7/28/12, Vlad Yasevich wrote: >> here is an untested prototype of what I was talking about. This should >> handle multiple data chunks. > > Yes, it works if only the end of the DATA chunk in a packet has > invalid stream identifier &g

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-29 Thread Xufeng Zhang
_ACK ERROR SACK ERROR", right? Thanks, Xufeng Zhang > > -vlad > > --- > include/net/sctp/command.h |1 + > net/sctp/sm_sideeffect.c | 22 ++ > net/sctp/sm_statefuns.c| 18 ++ > 3 files changed, 33 insertions(+)

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-25 Thread Xufeng Zhang
On 7/26/12, Vlad Yasevich wrote: > Xufeng Zhang wrote: > >>On 7/26/12, Xufeng Zhang wrote: >>> On 7/25/12, Vlad Yasevich wrote: >>>>> And after take a moment to look into the relative codes, I think we >>>>> can implement it >>>

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-25 Thread Xufeng Zhang
On 7/26/12, Xufeng Zhang wrote: > On 7/25/12, Vlad Yasevich wrote: >>> And after take a moment to look into the relative codes, I think we >>> can implement it >>> by below way: >>> 1). Add a flag(isi_err_needed) in the embedded struct peer of struct &g

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-25 Thread Xufeng Zhang
On 7/25/12, Neil Horman wrote: > On Wed, Jul 25, 2012 at 05:22:19PM +0800, Xufeng Zhang wrote: >> On 7/25/12, Xufeng Zhang wrote: >> > On 7/25/12, Vlad Yasevich wrote: >> >> >> >> Actually not true. AUTH can be before SACK. So can any addip

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-25 Thread Xufeng Zhang
ACK command actually don't enqueue SACK to outqueue, sctp_gen_sack() do this things when processing SCTP_CMD_GEN_SACK command in sctp_cmd_interpreter(). So it's not enough if we just insert SCTP_ERROR_INV_STRM command after sctp_eat_data() return SCTP_IERROR_BAD_STREAM in sctp_sf_e

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-25 Thread Xufeng Zhang
On 7/25/12, Xufeng Zhang wrote: > On 7/25/12, Vlad Yasevich wrote: >> >> Actually not true. AUTH can be before SACK. So can any addip chunks >> that >> aid in locating an association. >> >> Now AUTH isn't a big issue since its autogenerated to the

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-25 Thread Xufeng Zhang
K based on your commit "[SCTP]: Fix SACK sequence during shutdown". Maybe the only solution is to do some work on side effects just as you said. Thanks for your explanation! Thanks, Xufeng Zhang > > -vlad >> >>Thanks, >>Xufeng Zhang >>> >>>

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-24 Thread Xufeng Zhang
On 7/24/12, Neil Horman wrote: > On Tue, Jul 24, 2012 at 09:50:18AM +0800, xufeng zhang wrote: >> On 07/23/2012 08:14 PM, Neil Horman wrote: >> >On Mon, Jul 23, 2012 at 10:30:34AM +0800, xufeng zhang wrote: >> >>On 07/23/2012 08:49 AM, Neil Horman wrote: >> &

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-24 Thread Xufeng Zhang
lots of changes to side effect processing. I prefer to Neil Horman's way for the solution since only COOKIE_ACK chunk is allowed to place ahead of SACK chunk when bundling into one packet. What do you think? Thanks, Xufeng Zhang > > -vlad -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-23 Thread xufeng zhang
On 07/24/2012 10:27 AM, Vlad Yasevich wrote: xufeng zhang wrote: On 07/19/2012 01:57 PM, xufengzhang.m...@gmail.com wrote: When "Invalid Stream Identifier" ERROR happens after process the received DATA chunks, this ERROR chunk is enqueued into outqueue before SACK chun

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-23 Thread Xufeng Zhang
On 7/23/12, Neil Horman wrote: > On Mon, Jul 23, 2012 at 10:30:34AM +0800, xufeng zhang wrote: >> On 07/23/2012 08:49 AM, Neil Horman wrote: >> > >> >Not sure I understand how you came into this error. If we get an >> > invalid >> >stream, we issue a

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-22 Thread xufeng zhang
the outqueue, by this way, we introduce a flag 'has_isi_err' which indicate whether or not the "Invalid Stream Identifier" ERROR happens. Signed-off-by: Xufeng Zhang --- include/net/sctp/structs.h |2 ++ net/sctp/output.c | 26 ++ 2 fil

Re: [PATCH] sctp: Make "Invalid Stream Identifier" ERROR follows SACK when bundling

2012-07-22 Thread xufeng zhang
nfo_stream); + dp.stream = htons(sinfo->sinfo_stream) + 10; dp.ppid = sinfo->sinfo_ppid; /* Set the flags for an unordered send. */ Then run sctp_darn application and capture the sctp packet at the same time. Thanks, Xufeng Zhang Thanks! Neil -- To unsubscribe fro