Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
686ed0a0
Commit
686ed0a0
authored
Jun 04, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge
http://linux-lksctp.bkbits.net/lksctp-2.5.work
into nuts.davemloft.net:/disk1/BK/net-2.6
parents
6781fdec
e343efc8
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
100 additions
and
75 deletions
+100
-75
include/net/sctp/command.h
include/net/sctp/command.h
+1
-0
include/net/sctp/sm.h
include/net/sctp/sm.h
+17
-0
net/sctp/sm_sideeffect.c
net/sctp/sm_sideeffect.c
+10
-0
net/sctp/sm_statefuns.c
net/sctp/sm_statefuns.c
+62
-74
net/sctp/socket.c
net/sctp/socket.c
+10
-1
No files found.
include/net/sctp/command.h
View file @
686ed0a0
...
...
@@ -93,6 +93,7 @@ typedef enum {
SCTP_CMD_PROCESS_OPERR
,
/* Process an ERROR chunk. */
SCTP_CMD_REPORT_FWDTSN
,
/* Report new cumulative TSN Ack. */
SCTP_CMD_PROCESS_FWDTSN
,
/* Skips were reported, so process further. */
SCTP_CMD_CLEAR_INIT_TAG
,
/* Clears association peer's inittag. */
SCTP_CMD_LAST
}
sctp_verb_t
;
...
...
include/net/sctp/sm.h
View file @
686ed0a0
...
...
@@ -440,6 +440,23 @@ static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_a
BUG
();
}
/* Check VTAG of the packet matches the sender's own tag. */
static
inline
int
sctp_vtag_verify
(
const
struct
sctp_chunk
*
chunk
,
const
struct
sctp_association
*
asoc
)
{
/* RFC 2960 Sec 8.5 When receiving an SCTP packet, the endpoint
* MUST ensure that the value in the Verification Tag field of
* the received SCTP packet matches its own Tag. If the received
* Verification Tag value does not match the receiver's own
* tag value, the receiver shall silently discard the packet...
*/
if
(
ntohl
(
chunk
->
sctp_hdr
->
vtag
)
==
asoc
->
c
.
my_vtag
)
return
1
;
return
0
;
}
/* Check VTAG of the packet matches the sender's own tag OR its peer's
* tag and the T bit is set in the Chunk Flags.
*/
...
...
net/sctp/sm_sideeffect.c
View file @
686ed0a0
...
...
@@ -429,6 +429,9 @@ static void sctp_cmd_init_failed(sctp_cmd_seq_t *commands,
sctp_add_cmd_sf
(
commands
,
SCTP_CMD_EVENT_ULP
,
SCTP_ULPEVENT
(
event
));
sctp_add_cmd_sf
(
commands
,
SCTP_CMD_NEW_STATE
,
SCTP_STATE
(
SCTP_STATE_CLOSED
));
/* SEND_FAILED sent later when cleaning up the association. */
asoc
->
outqueue
.
error
=
error
;
sctp_add_cmd_sf
(
commands
,
SCTP_CMD_DELETE_TCB
,
SCTP_NULL
());
...
...
@@ -457,6 +460,10 @@ static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands,
sctp_add_cmd_sf
(
commands
,
SCTP_CMD_NEW_STATE
,
SCTP_STATE
(
SCTP_STATE_CLOSED
));
/* Set sk_err to ECONNRESET on a 1-1 style socket. */
if
(
!
sctp_style
(
asoc
->
base
.
sk
,
UDP
))
asoc
->
base
.
sk
->
sk_err
=
ECONNRESET
;
/* SEND_FAILED sent later when cleaning up the association. */
asoc
->
outqueue
.
error
=
error
;
sctp_add_cmd_sf
(
commands
,
SCTP_CMD_DELETE_TCB
,
SCTP_NULL
());
...
...
@@ -1272,6 +1279,9 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype,
case
SCTP_CMD_PROCESS_OPERR
:
sctp_cmd_process_operr
(
commands
,
asoc
,
chunk
);
break
;
case
SCTP_CMD_CLEAR_INIT_TAG
:
asoc
->
peer
.
i
.
init_tag
=
0
;
break
;
default:
printk
(
KERN_WARNING
"Impossible command: %u, %p
\n
"
,
cmd
->
verb
,
cmd
->
obj
.
ptr
);
...
...
net/sctp/sm_statefuns.c
View file @
686ed0a0
This diff is collapsed.
Click to expand it.
net/sctp/socket.c
View file @
686ed0a0
...
...
@@ -1164,6 +1164,11 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
if
(
!
asoc
)
{
SCTP_DEBUG_PRINTK
(
"There is no association yet.
\n
"
);
if
(
sinfo_flags
&
(
MSG_EOF
|
MSG_ABORT
))
{
err
=
-
EINVAL
;
goto
out_unlock
;
}
/* Check for invalid stream against the stream counts,
* either the default or the user specified stream counts.
*/
...
...
@@ -4388,7 +4393,11 @@ static int sctp_wait_for_connect(struct sctp_association *asoc, long *timeo_p)
return
err
;
do_error:
err
=
-
ECONNREFUSED
;
if
(
asoc
->
counters
[
SCTP_COUNTER_INIT_ERROR
]
+
1
>=
asoc
->
max_init_attempts
)
err
=
-
ETIMEDOUT
;
else
err
=
-
ECONNREFUSED
;
goto
out
;
do_interrupted:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment