From 30d9bbb191df6a3745f9b6198ad5727aa32f0498 Mon Sep 17 00:00:00 2001 From: rpe Date: Sun, 11 May 2014 08:23:46 +0000 Subject: [PATCH] Fix configuration of static IPv6 default gateway - Append IPv4 default gw to /tmp/mygate instead of overwriting it. - Delete /tmp/mygate at the beginning of configure_ifs() to reset previous default gw config on installer restarts. pointed out by todd@ OK halex@ krw@ --- distrib/miniroot/install.sub | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 62f288bc003..99aa670f55d 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.773 2014/05/10 17:25:21 rpe Exp $ +# $OpenBSD: install.sub,v 1.774 2014/05/11 08:23:46 rpe Exp $ # # Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback # All rights reserved. @@ -656,6 +656,9 @@ configure_ifs() { # Always need lo0 configured. ifconfig lo0 inet 127.0.0.1/8 + # In case of restart, delete previous default gateway config. + rm -f /tmp/mygate + while :; do # Create new vlan if possible. ifconfig vlan$_vl create >/dev/null 2>&1 @@ -983,7 +986,7 @@ v4_defroute() { ask_until "$_prompt" "$_dr" [[ $resp == @(none|dhcp) ]] && break route delete -inet default >/dev/null 2>&1 - route -n add -inet -host default "$resp" && { echo "$resp" >/tmp/mygate; break; } + route -n add -inet -host default "$resp" && { echo "$resp" >>/tmp/mygate; break; } # Put the old default route back. The new one did not work. route -n add -inet -host default $_dr >/dev/null 2>&1 done -- 2.20.1