Skip to content

Commit

Permalink
tcp-repair: Handle zero-length data put in rcv queue
Browse files Browse the repository at this point in the history
When sending data into a tcp socket in repair state we should check
for the amount of data being 0 explicitly. Otherwise we'll have an skb
with seq == end_seq in rcv queue, but tcp doesn't expect this to happen
(in particular a warn_on in tcp_recvmsg shoots).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Reported-by: Giorgos Mavrikas <gmavrikas@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Nov 3, 2012
1 parent a4d7e48 commit c454e61
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -4529,6 +4529,9 @@ int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size)
struct tcphdr *th;
bool fragstolen;

if (size == 0)
return 0;

skb = alloc_skb(size + sizeof(*th), sk->sk_allocation);
if (!skb)
goto err;
Expand Down

0 comments on commit c454e61

Please sign in to comment.