Reuse automatic ip6table value
authorSteven Barth <steven@midlink.org>
Mon, 10 Jun 2013 08:01:20 +0000 (10:01 +0200)
committerSteven Barth <steven@midlink.org>
Mon, 10 Jun 2013 08:01:20 +0000 (10:01 +0200)
interface.c

index a697326c1ddf617d72123af25d3f72d84e312f92..30e48cf526b778c9bb27a4a2b0d47370a03b0452 100644 (file)
@@ -588,8 +588,12 @@ interface_init(struct interface *iface, const char *name,
        }
 
        // Set a default exteranl routing table for IPv6 to do source-based-filtering
+       struct interface *iface_old = vlist_find(&interfaces, name, iface_old, node);
+       if (iface_old && iface_old->ip6table > 1000 && iface_old->ip6table < 2000)
+               iface->ip6table = iface_old->ip6table;
+       else
+               iface->ip6table = 1000 + ++interface_serial;
 
-       iface->ip6table = 1000 + ++interface_serial;
        if ((cur = tb[IFACE_ATTR_IP6TABLE])) {
                if (!system_resolve_rt_table(blobmsg_data(cur), &iface->ip6table))
                        DPRINTF("Failed to resolve routing table: %s\n", (char *) blobmsg_data(cur));