Commit d1256358 authored by Jon Grimm's avatar Jon Grimm

Merge http://linux-lksctp.bkbits.net/lksctp-2.5.work

into touki.austin.ibm.com:/home/jgrimm/bk/lksctp-2.5.work
parents 99c8d97d 4348f4a4
...@@ -2986,9 +2986,18 @@ int sctp_inet_listen(struct socket *sock, int backlog) ...@@ -2986,9 +2986,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? */
...@@ -3002,15 +3011,7 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait) ...@@ -3002,15 +3011,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment