[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091020054106.GA5507@gondor.apana.org.au>
Date: Tue, 20 Oct 2009 14:41:06 +0900
From: Herbert Xu <herbert@...dor.apana.org.au>
To: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: tcp: Try to catch MSG_PEEK bug
Hi:
tcp: Try to catch MSG_PEEK bug
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@...dor.apana.org.au>
Cheer,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 64d0af6..fb881d5 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1405,7 +1405,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. */
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists