diff options
author | jim-p <jimp@pfsense.org> | 2012-07-06 13:59:25 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-07-06 14:00:18 -0400 |
commit | 03a64d4591eab9c59f98e698a225adf2673100e3 (patch) | |
tree | c5f7e752499b6b6843a370310523d6db5915b5c1 /config/quagga_ospfd/quagga_ospfd.inc | |
parent | a682068a2c3f2951927443b1e5dbe018d606eb26 (diff) | |
download | pfsense-packages-03a64d4591eab9c59f98e698a225adf2673100e3.tar.gz pfsense-packages-03a64d4591eab9c59f98e698a225adf2673100e3.tar.bz2 pfsense-packages-03a64d4591eab9c59f98e698a225adf2673100e3.zip |
Fixup quagga's behavior for disabling redistribution of certain networks. Fixes #2542
Diffstat (limited to 'config/quagga_ospfd/quagga_ospfd.inc')
-rw-r--r-- | config/quagga_ospfd/quagga_ospfd.inc | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/config/quagga_ospfd/quagga_ospfd.inc b/config/quagga_ospfd/quagga_ospfd.inc index b5a63bd0..40d73786 100644 --- a/config/quagga_ospfd/quagga_ospfd.inc +++ b/config/quagga_ospfd/quagga_ospfd.inc @@ -142,6 +142,21 @@ function quagga_ospfd_install_conf() { } + $redist = ""; + $noredist = ""; + if (is_array($ospfd_conf['row'])) { + foreach ($ospfd_conf['row'] as $redistr) { + if (empty($redistr['routevalue'])) + continue; + if (isset($redistr['redistribute'])) { + $noredist .= " access-list dnr-list deny {$redistr['routevalue']}\n"; + } else { + $area = ($redistr['routearea'] == "") ? $ospfd_conf['area'] : $redistr['routearea']; + $redist .= " network {$redistr['routevalue']} area {$area}\n"; + } + } + } + /* OSPF Settings */ $conffile .= "\n\nrouter ospf\n"; @@ -193,21 +208,18 @@ function quagga_ospfd_install_conf() { } } - if (is_array($ospfd_conf['row'])) { - foreach ($ospfd_conf['row'] as $redistr) { - if (empty($redistr['routevalue'])) - continue; - if (isset($redistr['redistribute'])) { - $conffile .= " no "; - } - if ($redistr['routearea'] == "") { - $conffile .= " network {$redistr['routevalue']} area {$ospfd_conf['area']}\n"; - } - else { - $conffile .= " network {$redistr['routevalue']} area {$redistr['routearea']}\n"; - } - } + if (!empty($redist)) + $conffile .= $redist; + + if (!empty($noredist)) { + $conffile .= " distribute-list dnr-list out connected\n"; + $conffile .= " distribute-list dnr-list out kernel\n"; + $conffile .= " distribute-list dnr-list out static\n"; + //$conffile .= " distribute-list dnr-list out ospf\n"; + $conffile .= $noredist; + $conffile .= " access-list dnr-list permit any\n"; } + } safe_mkdir($quagga_config_base); $fd = fopen("{$quagga_config_base}/ospfd.conf", "w"); |