mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 23:21:46 +00:00
[SCTP]: Return socket errors only if the receive queue is empty.
This patch fixes an issue where it is possible to get valid data after a ENOTCONN error. It returns socket errors only after data queued on socket receive queue is consumed. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1b0997f561
commit
6736dc35e9
1 changed files with 5 additions and 5 deletions
|
@ -4743,11 +4743,6 @@ static struct sk_buff *sctp_skb_recv_datagram(struct sock *sk, int flags,
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
long timeo;
|
long timeo;
|
||||||
|
|
||||||
/* Caller is allowed not to check sk->sk_err before calling. */
|
|
||||||
error = sock_error(sk);
|
|
||||||
if (error)
|
|
||||||
goto no_packet;
|
|
||||||
|
|
||||||
timeo = sock_rcvtimeo(sk, noblock);
|
timeo = sock_rcvtimeo(sk, noblock);
|
||||||
|
|
||||||
SCTP_DEBUG_PRINTK("Timeout: timeo: %ld, MAX: %ld.\n",
|
SCTP_DEBUG_PRINTK("Timeout: timeo: %ld, MAX: %ld.\n",
|
||||||
|
@ -4774,6 +4769,11 @@ static struct sk_buff *sctp_skb_recv_datagram(struct sock *sk, int flags,
|
||||||
if (skb)
|
if (skb)
|
||||||
return skb;
|
return skb;
|
||||||
|
|
||||||
|
/* Caller is allowed not to check sk->sk_err before calling. */
|
||||||
|
error = sock_error(sk);
|
||||||
|
if (error)
|
||||||
|
goto no_packet;
|
||||||
|
|
||||||
if (sk->sk_shutdown & RCV_SHUTDOWN)
|
if (sk->sk_shutdown & RCV_SHUTDOWN)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue