Skip to content

Commit

Permalink
Merge pull request #4594 from RIOT-OS/quickfix_default_route_shell_ba…
Browse files Browse the repository at this point in the history
…ckport

shell fib: recognize the default route as net prefix (backport of #4584)
  • Loading branch information
cgundogan committed Jan 7, 2016
2 parents bcb3a8f + 326046e commit e44cd7e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sys/shell/commands/sc_fib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e44cd7e

Please sign in to comment.