summaryrefslogtreecommitdiffhomepage
path: root/proto.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-05-17 16:24:37 +0200
committerSteven Barth <steven@midlink.org>2013-05-17 16:24:37 +0200
commit2f31bff38d4dc2f36006ded6b8a7d039cb569eaa (patch)
tree0712ef82fedf0c105d9c587637f7c4ae1920a0b7 /proto.c
parentbc4a4bb127622c76085ecec7fd20448aad7bafaf (diff)
Add option to define target routing table for protocol routes.
This unifies source-routing for both IPv6 and IPv4 (default off). Based on a patch by Kristian Evensen
Diffstat (limited to 'proto.c')
-rw-r--r--proto.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/proto.c b/proto.c
index 676852d..dff5bbb 100644
--- a/proto.c
+++ b/proto.c
@@ -252,8 +252,9 @@ parse_gateway_option(struct interface *iface, struct blob_attr *attr, bool v6)
route->mask = 0;
route->flags = (v6 ? DEVADDR_INET6 : DEVADDR_INET4);
- if (v6) {
- route->table = interface_ip_resolve_v6_rtable(iface->l3_dev.dev->ifindex);
+ unsigned int table = (v6) ? iface->ip6table : iface->ip4table;
+ if (table) {
+ route->table = table;
route->flags |= DEVROUTE_SRCTABLE;
}