IPv6: Use source-routing to allow multi-wan
[project/netifd.git] / system-linux.c
index d788a01..4401f78 100644 (file)
@@ -581,6 +581,10 @@ int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg)
        system_set_dev_sysctl("/sys/devices/virtual/net/%s/bridge/multicast_snooping",
                bridge->ifname, cfg->igmp_snoop ? "1" : "0");
 
+       args[0] = BRCTL_SET_BRIDGE_PRIORITY;
+       args[1] = cfg->priority;
+       system_bridge_if(bridge->ifname, NULL, SIOCDEVPRIVATE, &args);
+
        if (cfg->flags & BRIDGE_OPT_AGEING_TIME) {
                args[0] = BRCTL_SET_AGEING_TIME;
                args[1] = sec_to_jiffies(cfg->ageing_time);
@@ -961,7 +965,8 @@ static int system_rt(struct device *dev, struct device_route *route, int cmd)
        unsigned char scope = (cmd == RTM_DELROUTE) ? RT_SCOPE_NOWHERE :
                        (have_gw) ? RT_SCOPE_UNIVERSE : RT_SCOPE_LINK;
 
-       unsigned int table = (route->flags & DEVROUTE_TABLE) ? route->table : RT_TABLE_MAIN;
+       unsigned int table = (route->flags & (DEVROUTE_TABLE | DEVROUTE_SRCTABLE))
+                       ? route->table : RT_TABLE_MAIN;
 
        struct rtmsg rtm = {
                .rtm_family = (alen == 4) ? AF_INET : AF_INET6,