From 2316d336da31f55cedd0e6368baedb9e0773cb90 Mon Sep 17 00:00:00 2001
From: Martine Lenders <mail@martine-lenders.eu>
Date: Thu, 22 Feb 2018 20:40:59 +0100
Subject: [PATCH] gnrc: keep speed optimizations of c2b403f4

---
 sys/net/gnrc/application_layer/tftp/gnrc_tftp.c | 2 +-
 sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c b/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c
index 6cf78233db..0c952e73fe 100644
--- a/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c
+++ b/sys/net/gnrc/application_layer/tftp/gnrc_tftp.c
@@ -367,7 +367,7 @@ int _tftp_init_ctxt(ipv6_addr_t *addr, const char *file_name,
     /* generate a random source UDP source port */
     do {
         ctxt->src_port = (random_uint32() & 0xff) + GNRC_TFTP_DEFAULT_SRC_PORT;
-    } while (gnrc_netreg_num(GNRC_NETTYPE_UDP, ctxt->src_port));
+    } while (gnrc_netreg_lookup(GNRC_NETTYPE_UDP, ctxt->src_port));
 
     return TS_FINISHED;
 }
diff --git a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
index ee9619f4ea..fa6cf2097c 100644
--- a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
+++ b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
@@ -219,7 +219,7 @@ static void _dispatch_next_header(gnrc_pktsnip_t *current, gnrc_pktsnip_t *pkt,
 
     /* dispatch IPv6 extension header only once */
     if (should_dispatch_current_type) {
-        bool should_release = (gnrc_netreg_num(GNRC_NETTYPE_IPV6, nh) == 0) &&
+        bool should_release = (!gnrc_netreg_lookup(GNRC_NETTYPE_IPV6, nh)) &&
                               (!interested);
 
         if (!should_release) {
-- 
GitLab