summaryrefslogtreecommitdiffhomepage
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/config.c b/config.c
index 843c53f..a35cda5 100644
--- a/config.c
+++ b/config.c
@@ -306,6 +306,17 @@ config_init_rules(void)
iprule_update_complete();
}
+static unsigned int
+lookup_global_integer(const char *name, unsigned int default_value)
+{
+ const char *value = uci_lookup_option_string(
+ uci_ctx, globals, name);
+ if (!value)
+ return default_value;
+
+ return atoi(value);
+}
+
static void
config_init_globals(void)
{
@@ -317,6 +328,14 @@ config_init_globals(void)
const char *ula_prefix = uci_lookup_option_string(
uci_ctx, globals, "ula_prefix");
interface_ip_set_ula_prefix(ula_prefix);
+
+ unsigned int priority_addr = lookup_global_integer(
+ "priority_addr", IPRULE_PRIORITY_ADDR);
+ interface_ip_set_addr_priority(priority_addr);
+
+ unsigned int priority_addr_mask = lookup_global_integer(
+ "priority_addr_mask", IPRULE_PRIORITY_ADDR_MASK);
+ interface_ip_set_addr_priority_mask(priority_addr_mask);
}
static void