From 0bdbb68959e040253f4d0b8c3f5600aed2be989b Mon Sep 17 00:00:00 2001 From: Martine Lenders <mail@martine-lenders.eu> Date: Sat, 17 Nov 2018 01:55:00 +0100 Subject: [PATCH] gnrc_ipv6: drop packets with unspecified destination It just doesn't makes sense to handle them any further --- sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c index d049c4c07e..f21a10f8b3 100644 --- a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c +++ b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c @@ -665,6 +665,12 @@ static void _send(gnrc_pktsnip_t *pkt, bool prep_hdr) gnrc_pktbuf_release_error(pkt, EINVAL); return; } + if (ipv6_addr_is_unspecified(&((ipv6_hdr_t *)pkt->data)->dst)) { + DEBUG("ipv6: destination address is unspecified address (::), " + "dropping packet \n"); + gnrc_pktbuf_release_error(pkt, EINVAL); + return; + } tmp_pkt = gnrc_pktbuf_start_write(pkt); if (tmp_pkt == NULL) { DEBUG("ipv6: unable to get write access to IPv6 header, dropping packet\n"); -- GitLab