aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@infradead.org>2018-07-17 21:27:45 -0400
committerDavid S. Miller <davem@davemloft.net>2018-07-18 18:26:33 -0400
commite56b8ce363a36fb7b74b80aaa5cc9084f2c908b4 (patch)
treead9b631bcfcf48e2e979b747544d7ac153e3bd19 /net/ipv4/tcp.c
parent9ba8376ce1e2cbf4ce44f7e4bee1d0648e10d594 (diff)
tcp: identify cryptic messages as TCP seq # bugs
Attempt to make cryptic TCP seq number error messages clearer by (1) identifying the source of the message as "TCP", (2) identifying the errors as "seq # bug", and (3) grouping the field identifiers and values by separating them with commas. E.g., the following message is changed from: recvmsg bug 2: copied 73BCB6CD seq 70F17CBE rcvnxt 73BCB9AA fl 0 WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:1881 tcp_recvmsg+0x649/0xb90 to: TCP recvmsg seq # bug 2: copied 73BCB6CD, seq 70F17CBE, rcvnxt 73BCB9AA, fl 0 WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:2011 tcp_recvmsg+0x694/0xba0 Suggested-by: 積丹尼 Dan Jacobson <jidanni@jidanni.org> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index ec2186e3087f..4491faf83f4f 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1998,7 +1998,7 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
1998 * shouldn't happen. 1998 * shouldn't happen.
1999 */ 1999 */
2000 if (WARN(before(*seq, TCP_SKB_CB(skb)->seq), 2000 if (WARN(before(*seq, TCP_SKB_CB(skb)->seq),
2001 "recvmsg bug: copied %X seq %X rcvnxt %X fl %X\n", 2001 "TCP recvmsg seq # bug: copied %X, seq %X, rcvnxt %X, fl %X\n",
2002 *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt, 2002 *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt,
2003 flags)) 2003 flags))
2004 break; 2004 break;
@@ -2013,7 +2013,7 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
2013 if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) 2013 if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
2014 goto found_fin_ok; 2014 goto found_fin_ok;
2015 WARN(!(flags & MSG_PEEK), 2015 WARN(!(flags & MSG_PEEK),
2016 "recvmsg bug 2: copied %X seq %X rcvnxt %X fl %X\n", 2016 "TCP recvmsg seq # bug 2: copied %X, seq %X, rcvnxt %X, fl %X\n",
2017 *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt, flags); 2017 *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt, flags);
2018 } 2018 }
2019 2019