Skip to content
Permalink
Browse files

net: utils: Print pkt address in net_pkt_hexdump()

It is useful in debugging if net_pkt pointer value is printed
in net_pkt_hexdump().

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information...
jukkar committed May 3, 2019
1 parent 802718a commit d20c6f96e63fea82e5ac75f35247e10e5a47dcff
Showing with 4 additions and 1 deletion.
  1. +4 −1 subsys/net/ip/net_private.h
@@ -147,13 +147,16 @@ static inline void net_hexdump(const char *str,
static inline void net_pkt_hexdump(struct net_pkt *pkt, const char *str)
{
struct net_buf *buf = pkt->buffer;
char pkt_str[sizeof("0x") + sizeof(intptr_t) * 2];

if (str && str[0]) {
LOG_DBG("%s", str);
}

snprintk(pkt_str, sizeof(pkt_str), "%p", pkt);

while (buf) {
LOG_HEXDUMP_DBG(buf->data, buf->len, "");
LOG_HEXDUMP_DBG(buf->data, buf->len, pkt_str);
buf = buf->frags;
}
}

0 comments on commit d20c6f9

Please sign in to comment.
You can’t perform that action at this time.