mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #10769 from miri64/gnrc_ipv6/enh/ipv6-sending-debug
gnrc_ipv6: add sending DEBUG output
This commit is contained in:
commit
add337cff9
@ -229,6 +229,8 @@ static void *_event_loop(void *args)
|
|||||||
|
|
||||||
static void _send_to_iface(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
|
static void _send_to_iface(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
|
||||||
{
|
{
|
||||||
|
const ipv6_hdr_t *hdr = pkt->next->data;
|
||||||
|
|
||||||
assert(netif != NULL);
|
assert(netif != NULL);
|
||||||
((gnrc_netif_hdr_t *)pkt->data)->if_pid = netif->pid;
|
((gnrc_netif_hdr_t *)pkt->data)->if_pid = netif->pid;
|
||||||
if (gnrc_pkt_len(pkt->next) > netif->ipv6.mtu) {
|
if (gnrc_pkt_len(pkt->next) > netif->ipv6.mtu) {
|
||||||
@ -237,6 +239,11 @@ static void _send_to_iface(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
|
|||||||
gnrc_pktbuf_release_error(pkt, EMSGSIZE);
|
gnrc_pktbuf_release_error(pkt, EMSGSIZE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
DEBUG("ipv6: Sending (src = %s, ",
|
||||||
|
ipv6_addr_to_str(addr_str, &hdr->src, sizeof(addr_str)));
|
||||||
|
DEBUG("dst = %s, next header = %u, length = %u)\n",
|
||||||
|
ipv6_addr_to_str(addr_str, &hdr->dst, sizeof(addr_str)), hdr->nh,
|
||||||
|
byteorder_ntohs(hdr->len));
|
||||||
#ifdef MODULE_NETSTATS_IPV6
|
#ifdef MODULE_NETSTATS_IPV6
|
||||||
netif->ipv6.stats.tx_success++;
|
netif->ipv6.stats.tx_success++;
|
||||||
netif->ipv6.stats.tx_bytes += gnrc_pkt_len(pkt->next);
|
netif->ipv6.stats.tx_bytes += gnrc_pkt_len(pkt->next);
|
||||||
|
Loading…
Reference in New Issue
Block a user