net: tcp: Fix TCP trace value debug

The TCP trace values were not printed because of incorrect
config option used. Print also seq and ack values in decimal
in order to make it easier to correlate the values in other
prints in tcp.c.

Change-Id: I44d1535a84dcba8c6c937d348516ba801193ca23
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2017-04-24 14:59:13 +03:00
commit 52d0589c1f

View file

@ -62,7 +62,7 @@ struct tcp_segment {
const struct sockaddr *dst_addr; const struct sockaddr *dst_addr;
}; };
#if defined(CONFIG_NET_DEBUG_TCP) && (CONFIG_SYS_LOG_NET_BUF_LEVEL > 2) #if defined(CONFIG_NET_DEBUG_TCP) && (CONFIG_SYS_LOG_NET_LEVEL > 2)
static char upper_if_set(char chr, bool set) static char upper_if_set(char chr, bool set)
{ {
if (set) { if (set) {
@ -85,12 +85,14 @@ static void net_tcp_trace(struct net_pkt *pkt, struct net_tcp *tcp)
rel_ack = ack ? ack - tcp->sent_ack : 0; rel_ack = ack ? ack - tcp->sent_ack : 0;
} }
NET_DBG("pkt %p src %u dst %u seq 0x%04x ack 0x%04x (%u) " NET_DBG("pkt %p src %u dst %u seq 0x%04x (%u) ack 0x%04x (%u/%u) "
"flags %c%c%c%c%c%c win %u chk 0x%04x", "flags %c%c%c%c%c%c win %u chk 0x%04x",
pkt, pkt,
ntohs(NET_TCP_HDR(pkt)->src_port), ntohs(NET_TCP_HDR(pkt)->src_port),
ntohs(NET_TCP_HDR(pkt)->dst_port), ntohs(NET_TCP_HDR(pkt)->dst_port),
sys_get_be32(NET_TCP_HDR(pkt)->seq), sys_get_be32(NET_TCP_HDR(pkt)->seq),
sys_get_be32(NET_TCP_HDR(pkt)->seq),
ack,
ack, ack,
/* This tells how many bytes we are acking now */ /* This tells how many bytes we are acking now */
rel_ack, rel_ack,