[3/3] Only call radvd_update if a zone contains an IPv6.

Submitted by Stefan Schantl on Jan. 25, 2017, 1:48 p.m.

Details

Message ID 20170125134821.15442-3-stefan.schantl@ipfire.org
State New
Headers show

Commit Message

Stefan Schantl Jan. 25, 2017, 1:48 p.m.
On systems which lacks any IPv6 configured zone, radvd would be
started with an empty configuration file and crashes which will
brick the system startup and results in a frozen system.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 src/functions/functions.routing | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/functions/functions.routing b/src/functions/functions.routing
index c7aac09..4824f34 100644
--- a/src/functions/functions.routing
+++ b/src/functions/functions.routing
@@ -81,7 +81,9 @@  routing_default_update() {
 		routes=$(echo ${routes})
 
 		# Reload radvd configuration
-		[[ "${proto}" = "ipv6" ]] && radvd_update
+		if [[ "${proto}" = "ipv6" ]] && db_exists "${zone}/ipv6"; then
+			radvd_update
+		fi
 
 		# Remove all default routes.
 		if [ -z "${routes}" ]; then

Comments

Stefan Schantl Jan. 25, 2017, 2:37 p.m.
Please ignore this patch,

it fixes the descibed issue on IPv4 only systems but there is another
issue with IPv6 as well which requires more and deeper work to get this
solved in a right way.

Thanks in advance,

-Stefan
> On systems which lacks any IPv6 configured zone, radvd would be
> started with an empty configuration file and crashes which will
> brick the system startup and results in a frozen system.
> 
> Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
> ---
>  src/functions/functions.routing | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/functions/functions.routing
> b/src/functions/functions.routing
> index c7aac09..4824f34 100644
> --- a/src/functions/functions.routing
> +++ b/src/functions/functions.routing
> @@ -81,7 +81,9 @@ routing_default_update() {
>  		routes=$(echo ${routes})
>  
>  		# Reload radvd configuration
> -		[[ "${proto}" = "ipv6" ]] && radvd_update
> +		if [[ "${proto}" = "ipv6" ]] && db_exists
> "${zone}/ipv6"; then
> +			radvd_update
> +		fi
>  
>  		# Remove all default routes.
>  		if [ -z "${routes}" ]; then