Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shell fib: recognize the default route as net prefix (backport of #4584) #4594

Merged
merged 1 commit into from
Jan 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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