From 300a936e42ca3073b2ae99da94395909a410089e Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 15 Nov 2024 16:59:08 +0100 Subject: [PATCH] gnrc: add comment about gnrc_pktbuf_hold() use --- sys/net/gnrc/netapi/gnrc_netapi.c | 1 + sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/gnrc/netapi/gnrc_netapi.c b/sys/net/gnrc/netapi/gnrc_netapi.c index 266d0839f3..a8cecb285b 100644 --- a/sys/net/gnrc/netapi/gnrc_netapi.c +++ b/sys/net/gnrc/netapi/gnrc_netapi.c @@ -92,6 +92,7 @@ int gnrc_netapi_dispatch(gnrc_nettype_t type, uint32_t demux_ctx, if (numof != 0) { gnrc_netreg_entry_t *sendto = gnrc_netreg_lookup(type, demux_ctx); + /* the packet is replicated over all interfaces that is's being sent on */ gnrc_pktbuf_hold(pkt, numof - 1); while (sendto) { diff --git a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c index fea9c412b6..5fbabfb625 100644 --- a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c +++ b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c @@ -576,7 +576,7 @@ static void _send_multicast(gnrc_pktsnip_t *pkt, bool prep_hdr, if (!gnrc_netif_highlander()) { /* interface not given: send over all interfaces */ if (netif == NULL) { - /* send packet to link layer */ + /* the packet is replicated over all interfaces that is's being sent on */ gnrc_pktbuf_hold(pkt, ifnum - 1); while ((netif = gnrc_netif_iter(netif))) {