Skip to content

Commit

Permalink
net: use WARN() for the WARN_ON in commit b6b39e8
Browse files Browse the repository at this point in the history
Commit b6b39e8 (tcp: Try to catch MSG_PEEK bug) added a printk()
to the WARN_ON() that's in tcp.c. This patch changes this combination
to WARN(); the advantage of WARN() is that the printk message shows up
inside the message, so that kerneloops.org will collect the message.

In addition, this gets rid of an extra if() statement.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arjan van de Ven authored and David S. Miller committed Oct 23, 2009
1 parent 74eee2e commit c62f4c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,9 +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;
if (WARN_ON(!(flags & MSG_PEEK)))
printk(KERN_INFO "recvmsg bug 2: copied %X "
"seq %X\n", *seq, TCP_SKB_CB(skb)->seq);
WARN(!(flags & MSG_PEEK), 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 c62f4c4

Please sign in to comment.