From e11295ebe4b7421bfda01b448b9089e6c13213d4 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Mon, 15 Feb 2016 11:22:07 +0200 Subject: [PATCH] net: contiki: If outgoing packet is dropped then print more info Change-Id: Ibac9592f9af5bd5ad2b984752bd8e3a0542d00b5 Signed-off-by: Jukka Rissanen --- net/ip/contiki/ip/tcpip.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/ip/contiki/ip/tcpip.c b/net/ip/contiki/ip/tcpip.c index 93c8a2c847a..38497b9d79e 100644 --- a/net/ip/contiki/ip/tcpip.c +++ b/net/ip/contiki/ip/tcpip.c @@ -663,6 +663,8 @@ tcpip_ipv6_output(struct net_buf *buf) if(nbr == NULL) { #if UIP_ND6_SEND_NA if((nbr = uip_ds6_nbr_add(nexthop, NULL, 0, NBR_INCOMPLETE)) == NULL) { + PRINTF("IP packet buf %p len %d discarded because cannot " + "add neighbor\n", buf, uip_len(buf)); uip_len(buf) = 0; uip_ext_len(buf) = 0; return 0; @@ -673,6 +675,9 @@ tcpip_ipv6_output(struct net_buf *buf) memcpy(uip_packetqueue_buf(&nbr->packethandle), UIP_IP_BUF(buf), uip_len(buf)); uip_packetqueue_set_buflen(&nbr->packethandle, uip_len(buf)); } +#else + PRINTF("IP packet buf %p len %d discarded because NS is " + "being sent\n", buf, uip_len(buf)); #endif /* RFC4861, 7.2.2: * "If the source address of the packet prompting the solicitation is the @@ -705,6 +710,9 @@ tcpip_ipv6_output(struct net_buf *buf) memcpy(uip_packetqueue_buf(&nbr->packethandle), UIP_IP_BUF(buf), uip_len(buf)); uip_packetqueue_set_buflen(&nbr->packethandle, uip_len(buf)); } +#else + PRINTF("IP packet buf %p len %d discarded because neighbor info is " + "not yet received\n", buf, uip_len(buf)); #endif /*UIP_CONF_IPV6_QUEUE_PKT*/ uip_len(buf) = 0; uip_ext_len(buf) = 0;