From 931788ad45b4f1114e97e6ac2869ab84efa767e2 Mon Sep 17 00:00:00 2001 From: Guillaume Mazoyer Date: Mon, 13 Jun 2016 11:23:09 +0200 Subject: Per router options to disable/enable IP versions. Remove the global options to disable/enable IPv6 or IPv4. These options can now be used on the router configuration level, which seems more appropriate. --- includes/config.defaults.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'includes') diff --git a/includes/config.defaults.php b/includes/config.defaults.php index dfc0d58..fa17f66 100644 --- a/includes/config.defaults.php +++ b/includes/config.defaults.php @@ -24,6 +24,22 @@ * Make changes to the configuration array in config.php. */ +function set_defaults_for_routers(&$parsed_config) { + $router_defaults = array( + 'disable_ipv6' => false, + 'disable_ipv4' => false + ); + + // Loads defaults when key does not exist + foreach ($parsed_config['routers'] as &$router) { + foreach ($router_defaults as $key => $value) { + if (!array_key_exists($key, $router)) { + $router[$key] = $value; + } + } + } +} + $config = array( // Release configuration @@ -92,11 +108,7 @@ $config = array( 'allow_private_ip' => true, // Allow reserved IPv4 addresses (0.0.0.0/8, 169.254.0.0/16, // 192.0.2.0/24 and 224.0.0.0/4) - 'allow_reserved_ip' => true, - // Disable IPv6 - 'disable_ipv6' => false, - // Disable IPv4 - 'disable_ipv4' => false + 'allow_reserved_ip' => true ), // Tools used for some processing -- cgit v1.2.3