Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145140
b: refs/heads/master
c: 7752731
h: refs/heads/master
v: v3
  • Loading branch information
Ilpo Järvinen authored and David S. Miller committed May 18, 2009
1 parent 20e7af6 commit b72848f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 705efc3b03cbee449e4d83b230423894152f7982
refs/heads/master: 775273131810caa41dfc7f9e552ea5d8508caf40
5 changes: 4 additions & 1 deletion trunk/net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1321,6 +1321,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
struct task_struct *user_recv = NULL;
int copied_early = 0;
struct sk_buff *skb;
u32 urg_hole = 0;

lock_sock(sk);

Expand Down Expand Up @@ -1532,7 +1533,8 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
}
}
}
if ((flags & MSG_PEEK) && peek_seq != tp->copied_seq) {
if ((flags & MSG_PEEK) &&
(peek_seq - copied - urg_hole != tp->copied_seq)) {
if (net_ratelimit())
printk(KERN_DEBUG "TCP(%s:%d): Application bug, race in MSG_PEEK.\n",
current->comm, task_pid_nr(current));
Expand All @@ -1553,6 +1555,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (!urg_offset) {
if (!sock_flag(sk, SOCK_URGINLINE)) {
++*seq;
urg_hole++;
offset++;
used--;
if (!used)
Expand Down

0 comments on commit b72848f

Please sign in to comment.