summaryrefslogtreecommitdiff
path: root/sysdep/bsd/krt-sock.c
diff options
context:
space:
mode:
authorJan Maria Matejka <mq@ucw.cz>2017-12-13 10:29:10 +0100
committerJan Maria Matejka <mq@ucw.cz>2017-12-13 10:29:10 +0100
commitcb21c5ffa92494b1a4bf110605509de3326b6c3d (patch)
treebd1c37b57c1d1aa45efecf4868ddf7d3ff27c489 /sysdep/bsd/krt-sock.c
parent71c51aa4ab0daa3490f9a488f505eb25102c4705 (diff)
parent1e11918c8c56e3505193f4e6426c1a34aaae3941 (diff)
Merge branch 'int-new' of gitlab.labs.nic.cz:labs/bird into int-new
Diffstat (limited to 'sysdep/bsd/krt-sock.c')
-rw-r--r--sysdep/bsd/krt-sock.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
index 604cd510..0a52cfbd 100644
--- a/sysdep/bsd/krt-sock.c
+++ b/sysdep/bsd/krt-sock.c
@@ -74,11 +74,11 @@ const int rt_default_ecmp = 0;
/* Dynamic max number of tables */
-int krt_max_tables;
+uint krt_max_tables;
#ifdef KRT_USE_SYSCTL_NET_FIBS
-static int
+static uint
krt_get_max_tables(void)
{
int fibs;
@@ -90,7 +90,11 @@ krt_get_max_tables(void)
return 1;
}
- return MIN(fibs, KRT_MAX_TABLES);
+ /* Should not happen */
+ if (fibs < 1)
+ return 1;
+
+ return (uint) MIN(fibs, KRT_MAX_TABLES);
}
#else