Skip to content

Commit

Permalink
gnrc_icmpv6_error: use gnrc_netif_hdr_get/set_netif()
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Jul 25, 2019
1 parent 4231b7c commit e865f4e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sys/net/gnrc/network_layer/icmpv6/error/gnrc_icmpv6_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,15 @@ static void _send(gnrc_pktsnip_t *pkt, const gnrc_pktsnip_t *orig_pkt,
if (netif) {
/* copy interface from original netif header to assure packet
* goes out where it came from */
gnrc_netif_hdr_t *netif_hdr = netif->data;
kernel_pid_t netif_pid = netif_hdr->if_pid;
gnrc_netif_t *iface = gnrc_netif_hdr_get_netif(netif->data);

netif = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
if (netif == NULL) {
DEBUG("gnrc_icmpv6_error: No space in packet buffer left\n");
gnrc_pktbuf_release(pkt);
return;
}
netif_hdr = netif->data;
netif_hdr->if_pid = netif_pid;
gnrc_netif_hdr_set_netif(netif->data, iface);
LL_PREPEND(pkt, netif);
}
if (!gnrc_netapi_dispatch_send(GNRC_NETTYPE_IPV6,
Expand Down

0 comments on commit e865f4e

Please sign in to comment.