From: Steven Barth Date: Fri, 20 Jun 2014 17:50:13 +0000 (+0200) Subject: interface: don't store table id in route if the default table is used X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=4452867c4b34cb0d9dc7fe9dc42ecc86af887176;p=project%2Fnetifd.git interface: don't store table id in route if the default table is used Use system_is_default_rt_table() to test whether the resolved routing table is the default one, in this case do not apply the table attribute to the route object. This is needed for backwards compatibility - only routes using a non-default table shall report it in the ifstatus output. Signed-off-by: Jo-Philipp Wich --- diff --git a/interface-ip.c b/interface-ip.c index 715e498..587826a 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -365,6 +365,10 @@ interface_ip_add_route(struct interface *iface, struct blob_attr *attr, bool v6) goto error; } + /* only set the table flag if not using the main (default) table */ + if (system_is_default_rt_table(route->table)) + route->table = 0; + if (route->table) route->flags |= DEVROUTE_TABLE; }