From 0be213200a2ad8302996c417893e32a9b167cd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 22 Dec 2014 00:04:16 +0100 Subject: [PATCH] network: fix NM config preparation The same variables are reused to configure downlink in ProxyVM, so create NM config before they got overrided. Conflicts: network/setup-ip --- network/setup-ip | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/network/setup-ip b/network/setup-ip index 0bc02f9..3e9bebf 100755 --- a/network/setup-ip +++ b/network/setup-ip @@ -13,18 +13,6 @@ if [ x$ip != x ]; then /sbin/ethtool -K $INTERFACE tx off echo "nameserver $gateway" > /etc/resolv.conf echo "nameserver $secondary_dns" >> /etc/resolv.conf - network=$(/usr/bin/qubesdb-read /qubes-netvm-network 2>/dev/null) - if [ "x$network" != "x" ]; then - gateway=$(/usr/bin/qubesdb-read /qubes-netvm-gateway) - netmask=$(/usr/bin/qubesdb-read /qubes-netvm-netmask) - secondary_dns=$(/usr/bin/qubesdb-read /qubes-netvm-secondary-dns) - echo "NS1=$gateway" > /var/run/qubes/qubes-ns - echo "NS2=$secondary_dns" >> /var/run/qubes/qubes-ns - /usr/lib/qubes/qubes-setup-dnat-to-ns - [ -x /rw/config/qubes-ip-change-hook ] && /rw/config/qubes-ip-change-hook - # XXX: Backward compatibility - [ -x /rw/config/qubes_ip_change_hook ] && /rw/config/qubes_ip_change_hook - fi if [ -f /var/run/qubes-service/network-manager ]; then cat > /etc/NetworkManager/system-connections/qubes-uplink-$INTERFACE <<__EOF__ [802-3-ethernet] @@ -49,4 +37,16 @@ may-fail=false __EOF__ chmod 600 /etc/NetworkManager/system-connections/qubes-uplink-$INTERFACE fi + network=$(qubesdb-read /qubes-netvm-network 2>/dev/null) + if [ "x$network" != "x" ]; then + gateway=$(qubesdb-read /qubes-netvm-gateway) + netmask=$(qubesdb-read /qubes-netvm-netmask) + secondary_dns=$(qubesdb-read /qubes-netvm-secondary-dns) + echo "NS1=$gateway" > /var/run/qubes/qubes-ns + echo "NS2=$secondary_dns" >> /var/run/qubes/qubes-ns + /usr/lib/qubes/qubes-setup-dnat-to-ns + [ -x /rw/config/qubes-ip-change-hook ] && /rw/config/qubes-ip-change-hook + # XXX: Backward compatibility + [ -x /rw/config/qubes_ip_change_hook ] && /rw/config/qubes_ip_change_hook + fi fi