aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-04-14 07:09:36 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-14 07:09:36 -0400
commit569508c964a8b5235e00998523bc3acd3f6aff01 (patch)
treebae516f4df35e08cc515e49d36e6a8c14b8441da /net/ipv4
parenta7d632b6b4ad1c92746ed409e41f9dc571ec04e2 (diff)
[TCP]: Format addresses appropriately in debug messages.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_input.c25
-rw-r--r--net/ipv4/tcp_timer.c12
2 files changed, 29 insertions, 8 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 3c6c7d7a7b0a..1bdb1bd22134 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2309,12 +2309,25 @@ static void DBGUNDO(struct sock *sk, const char *msg)
2309 struct tcp_sock *tp = tcp_sk(sk); 2309 struct tcp_sock *tp = tcp_sk(sk);
2310 struct inet_sock *inet = inet_sk(sk); 2310 struct inet_sock *inet = inet_sk(sk);
2311 2311
2312 printk(KERN_DEBUG "Undo %s " NIPQUAD_FMT "/%u c%u l%u ss%u/%u p%u\n", 2312 if (sk->sk_family == AF_INET) {
2313 msg, 2313 printk(KERN_DEBUG "Undo %s " NIPQUAD_FMT "/%u c%u l%u ss%u/%u p%u\n",
2314 NIPQUAD(inet->daddr), ntohs(inet->dport), 2314 msg,
2315 tp->snd_cwnd, tcp_left_out(tp), 2315 NIPQUAD(inet->daddr), ntohs(inet->dport),
2316 tp->snd_ssthresh, tp->prior_ssthresh, 2316 tp->snd_cwnd, tcp_left_out(tp),
2317 tp->packets_out); 2317 tp->snd_ssthresh, tp->prior_ssthresh,
2318 tp->packets_out);
2319 }
2320#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
2321 else if (sk->sk_family == AF_INET6) {
2322 struct ipv6_pinfo *np = inet6_sk(sk);
2323 printk(KERN_DEBUG "Undo %s " NIP6_FMT "/%u c%u l%u ss%u/%u p%u\n",
2324 msg,
2325 NIP6(np->daddr), ntohs(inet->dport),
2326 tp->snd_cwnd, tcp_left_out(tp),
2327 tp->snd_ssthresh, tp->prior_ssthresh,
2328 tp->packets_out);
2329 }
2330#endif
2318} 2331}
2319#else 2332#else
2320#define DBGUNDO(x...) do { } while (0) 2333#define DBGUNDO(x...) do { } while (0)
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index e588d6dc2a81..4de68cf5f2aa 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -299,12 +299,20 @@ static void tcp_retransmit_timer(struct sock *sk)
299 * we cannot allow such beasts to hang infinitely. 299 * we cannot allow such beasts to hang infinitely.
300 */ 300 */
301#ifdef TCP_DEBUG 301#ifdef TCP_DEBUG
302 if (1) { 302 struct inet_sock *inet = inet_sk(sk);
303 struct inet_sock *inet = inet_sk(sk); 303 if (sk->sk_family == AF_INET) {
304 LIMIT_NETDEBUG(KERN_DEBUG "TCP: Treason uncloaked! Peer " NIPQUAD_FMT ":%u/%u shrinks window %u:%u. Repaired.\n", 304 LIMIT_NETDEBUG(KERN_DEBUG "TCP: Treason uncloaked! Peer " NIPQUAD_FMT ":%u/%u shrinks window %u:%u. Repaired.\n",
305 NIPQUAD(inet->daddr), ntohs(inet->dport), 305 NIPQUAD(inet->daddr), ntohs(inet->dport),
306 inet->num, tp->snd_una, tp->snd_nxt); 306 inet->num, tp->snd_una, tp->snd_nxt);
307 } 307 }
308#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
309 else if (sk->sk_family == AF_INET6) {
310 struct ipv6_pinfo *np = inet6_sk(sk);
311 LIMIT_NETDEBUG(KERN_DEBUG "TCP: Treason uncloaked! Peer " NIP6_FMT ":%u/%u shrinks window %u:%u. Repaired.\n",
312 NIP6(np->daddr), ntohs(inet->dport),
313 inet->num, tp->snd_una, tp->snd_nxt);
314 }
315#endif
308#endif 316#endif
309 if (tcp_time_stamp - tp->rcv_tstamp > TCP_RTO_MAX) { 317 if (tcp_time_stamp - tp->rcv_tstamp > TCP_RTO_MAX) {
310 tcp_write_err(sk); 318 tcp_write_err(sk);