Skip to content

Commit

Permalink
tcp: Try to catch MSG_PEEK bug
Browse files Browse the repository at this point in the history
This patch tries to print out more information when we hit the
MSG_PEEK bug in tcp_recvmsg.  It's been around since at least
2005 and it's about time that we finally fix it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Oct 20, 2009
1 parent 55b8050 commit b6b39e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,9 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
goto found_ok_skb;
if (tcp_hdr(skb)->fin)
goto found_fin_ok;
WARN_ON(!(flags & MSG_PEEK));
if (WARN_ON(!(flags & MSG_PEEK)))
printk(KERN_INFO "recvmsg bug 2: copied %X "
"seq %X\n", *seq, TCP_SKB_CB(skb)->seq);
}

/* Well, if we have backlog, try to process it now yet. */
Expand Down

0 comments on commit b6b39e8

Please sign in to comment.