From c8509026e1d946817b93b7231d7b58dedcc3b33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Wed, 3 Mar 2010 21:05:56 +0000 Subject: Fix creation of interface settings written on config. Add passive option. Allow redistribute rules to be specified. --- config/openospfd/openospfd.inc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'config/openospfd/openospfd.inc') diff --git a/config/openospfd/openospfd.inc b/config/openospfd/openospfd.inc index d64e8774..d38ec82f 100644 --- a/config/openospfd/openospfd.inc +++ b/config/openospfd/openospfd.inc @@ -54,13 +54,21 @@ function ospfd_install_conf() { if ($ospfd_conf['updatefib']) $conffile .= "fib-update no\n"; + if (is_array($ospfd_conf['row'])) { + foreach ($ospfd_conf['row'] as $redistr) { + if (isset($redistr['redistribute'])) + $conffile .= "no "; + $conffile .= "redistribute {$redistr['routevalue']}\n"; + } + } + if ($ospfd_conf['redistributeconnectedsubnets']) $conffile .= "redistribute connected\n"; if ($ospfd_conf['redistributedefaultroute']) $conffile .= "redistribute default\n"; - if ($ospfd_conf['resdistributestatic']) + if ($ospfd_conf['redistributestatic']) $conffile .= "redistribute static\n"; if ($ospfd_conf['spfholdtime']) @@ -78,6 +86,7 @@ function ospfd_install_conf() { foreach ($config['installedpackages']['ospfdinterfaces']['config'] as $conf) { $conffile .= "\tinterface " . $config['interfaces'][$conf['interface']]['if']; $options_present = false; + $ifconfigs = ""; if (!empty($conf['metric'])) { $options_present = true; $ifconfigs .= "\t\tmetric {$conf['metric']}\n"; @@ -108,6 +117,10 @@ function ospfd_install_conf() { $options_present = true; $ifconfigs .= "\t\trouter-dead-time {$conf['deadtimer']}\n"; } + if (!empty($conf['passive'])) { + $options_present = true; + $ifconfigs .= "\t\tpassive\n"; + } if (!empty($ifconfigs)) { $conffile .= " {\n {$ifconfigs} \n"; if ($options_present == true) -- cgit v1.2.3