From e1776b88ed746f666a7384db414e119f11f1b069 Mon Sep 17 00:00:00 2001 From: "Danilo G. Baio (dbaio)" Date: Thu, 20 Feb 2014 14:30:50 -0300 Subject: openbgpd - fix blank listenip option --- config/openbgpd/openbgpd.inc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'config/openbgpd') diff --git a/config/openbgpd/openbgpd.inc b/config/openbgpd/openbgpd.inc index 9af83758..76aeb54f 100644 --- a/config/openbgpd/openbgpd.inc +++ b/config/openbgpd/openbgpd.inc @@ -90,9 +90,11 @@ function openbgpd_install_conf() { $conffile .= "holdtime {$openbgpd_conf['holdtime']}\n"; // Specify listen ip - if($openbgpd_conf['listenip']) + if(!empty($openbgpd_conf['listenip'])) $conffile .= "listen on {$openbgpd_conf['listenip']}\n"; - + else + $conffile .= "listen on 0.0.0.0\n"; + // Specify router id if($openbgpd_conf['routerid']) $conffile .= "router-id {$openbgpd_conf['routerid']}\n"; @@ -127,8 +129,11 @@ function openbgpd_install_conf() { $conffile .= "\t\t{$row['parameters']} {$row['parmvalue']} \n"; } } - if ($setlocaladdr == true) + if ($setlocaladdr == true && !empty($openbgpd_conf['listenip'])) $conffile .= "\t\tlocal-address {$openbgpd_conf['listenip']}\n"; + else + $conffile .= "\t\tlocal-address 0.0.0.0\n"; + $conffile .= "}\n"; } } @@ -157,8 +162,11 @@ function openbgpd_install_conf() { $conffile .= "\t{$row['parameters']} {$row['parmvalue']} \n"; } } - if ($setlocaladdr == true) + if ($setlocaladdr == true && !empty($openbgpd_conf['listenip'])) $conffile .= "\tlocal-address {$openbgpd_conf['listenip']}\n"; + else + $conffile .= "\tlocal-address 0.0.0.0\n"; + $conffile .= "}\n"; } } -- cgit v1.2.3