From b8ba3f589f83e1a3e20123a2084dabcb05e23247 Mon Sep 17 00:00:00 2001
From: BytesGalore <Martin.Landsmann@HAW-Hamburg.de>
Date: Wed, 6 Jan 2016 15:51:44 +0100
Subject: [PATCH] shell fib: recognize the default route as net prefix

---
 sys/shell/commands/sc_fib.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sys/shell/commands/sc_fib.c b/sys/shell/commands/sc_fib.c
index 492941a1b4..f96017a817 100644
--- a/sys/shell/commands/sc_fib.c
+++ b/sys/shell/commands/sc_fib.c
@@ -101,6 +101,16 @@ static void _fib_add(const char *dest, const char *next, kernel_pid_t pid, uint3
         nxt_size = INADDRSZ;
     }
 
+    /* Set the prefix flag for a network */
+    dst_flags |= FIB_FLAG_NET_PREFIX;
+    for (size_t i = 0; i < dst_size; ++i) {
+        if (dst[i] != 0) {
+            /* and clear the bit if its not the default route */
+            dst_flags = (dst_flags & ~FIB_FLAG_NET_PREFIX);
+            break;
+        }
+    }
+
     fib_add_entry(&gnrc_ipv6_fib_table, pid, dst, dst_size, dst_flags, nxt,
                   nxt_size, nxt_flags, lifetime);
 }
-- 
GitLab