summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2014-04-07 13:30:50 +0200
committerFelix Fietkau <nbd@openwrt.org>2014-04-26 21:37:41 +0200
commit50640800da52239eb6bff87a32fb5253c3ef5824 (patch)
treeaba4ed2b67ab057186e7af31f1f6aaed31be97b0
parentae3c6891596950ac7c2d5c45a078ab51efc53d99 (diff)
netifd: Check rt_table parameter when comparing routes
Allows to add identical routes in different routing tables Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
-rw-r--r--interface-ip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/interface-ip.c b/interface-ip.c
index b000725..208ec3f 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -400,6 +400,9 @@ route_cmp(const void *k1, const void *k2, void *ptr)
if (r1->sourcemask != r2->sourcemask)
return r1->sourcemask - r2->sourcemask;
+ if (r1->table != r2->table)
+ return r1->table - r2->table;
+
int maskcmp = memcmp(&r1->source, &r2->source, sizeof(r1->source));
if (maskcmp)
return maskcmp;