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
1e0a56a4
Commit
1e0a56a4
authored
Apr 21, 2003
by
Sridhar Samudrala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SCTP] Return a readable event when polling on a TCP-style listening
socket with a non-empty accept queue.
parent
6cf4b403
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
net/sctp/socket.c
net/sctp/socket.c
+9
-8
No files found.
net/sctp/socket.c
View file @
1e0a56a4
...
@@ -2878,9 +2878,18 @@ int sctp_inet_listen(struct socket *sock, int backlog)
...
@@ -2878,9 +2878,18 @@ int sctp_inet_listen(struct socket *sock, int backlog)
unsigned
int
sctp_poll
(
struct
file
*
file
,
struct
socket
*
sock
,
poll_table
*
wait
)
unsigned
int
sctp_poll
(
struct
file
*
file
,
struct
socket
*
sock
,
poll_table
*
wait
)
{
{
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
struct
sctp_opt
*
sp
=
sctp_sk
(
sk
);
unsigned
int
mask
;
unsigned
int
mask
;
poll_wait
(
file
,
sk
->
sleep
,
wait
);
poll_wait
(
file
,
sk
->
sleep
,
wait
);
/* A TCP-style listening socket becomes readable when the accept queue
* is not empty.
*/
if
((
SCTP_SOCKET_TCP
==
sp
->
type
)
&&
(
SCTP_SS_LISTENING
==
sk
->
state
))
return
(
!
list_empty
(
&
sp
->
ep
->
asocs
))
?
(
POLLIN
|
POLLRDNORM
)
:
0
;
mask
=
0
;
mask
=
0
;
/* Is there any exceptional events? */
/* Is there any exceptional events? */
...
@@ -2894,15 +2903,7 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
...
@@ -2894,15 +2903,7 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
(
sk
->
shutdown
&
RCV_SHUTDOWN
))
(
sk
->
shutdown
&
RCV_SHUTDOWN
))
mask
|=
POLLIN
|
POLLRDNORM
;
mask
|=
POLLIN
|
POLLRDNORM
;
/*
* FIXME: We need to set SCTP_SS_DISCONNECTING for TCP-style and
* peeled off sockets. Additionally, TCP-style needs to consider
* other establishment conditions.
*/
if
(
SCTP_SOCKET_UDP
!=
sctp_sk
(
sk
)
->
type
)
{
if
(
SCTP_SOCKET_UDP
!=
sctp_sk
(
sk
)
->
type
)
{
/* The association is going away. */
if
(
SCTP_SS_DISCONNECTING
==
sk
->
state
)
mask
|=
POLLHUP
;
/* The association is either gone or not ready. */
/* The association is either gone or not ready. */
if
(
SCTP_SS_CLOSED
==
sk
->
state
)
if
(
SCTP_SS_CLOSED
==
sk
->
state
)
return
mask
;
return
mask
;
...
...
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