Don't initialize the 'vs' interface by default
authorRobert Swiecki <swiecki@google.com>
Mon, 29 Feb 2016 16:50:25 +0000 (17:50 +0100)
committerRobert Swiecki <swiecki@google.com>
Mon, 29 Feb 2016 16:50:25 +0000 (17:50 +0100)
cmdline.c
net.c

index 727dd75a0a8dc2af6ffc9a52efb4680297b5c53c..d48aabd251660c1e04710b85f8449be87d06cbfc 100644 (file)
--- a/cmdline.c
+++ b/cmdline.c
@@ -284,7 +284,7 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf)
                .mount_proc = true,
                .iface_no_lo = false,
                .iface = NULL,
-               .iface_vs_ip = "192.168.255.2",
+               .iface_vs_ip = "0.0.0.0",
                .iface_vs_nm = "255.255.255.0",
                .iface_vs_gw = "0.0.0.0",
        };
diff --git a/net.c b/net.c
index f32f070dd04a64d9dcc5a5e37199102374514414..fee16aad2661e52e75f97637564f961f8f7af375 100644 (file)
--- a/net.c
+++ b/net.c
@@ -312,6 +312,11 @@ bool netConfigureVs(struct nsjconf_t * nsjconf)
                close(sock);
                return false;
        }
+       if (addr.s_addr == INADDR_ANY) {
+               LOG_I("IP address for interface '%s' not set", IFACE_NAME);
+               return true;
+       }
+
        struct sockaddr_in *sa = (struct sockaddr_in *)(&ifr.ifr_addr);
        sa->sin_family = AF_INET;
        sa->sin_addr = addr;
@@ -343,7 +348,6 @@ bool netConfigureVs(struct nsjconf_t * nsjconf)
                close(sock);
                return false;
        }
-
        if (addr.s_addr == INADDR_ANY) {
                LOG_I("Gateway address for '%s' is 0.0.0.0. Not adding the default route",
                      IFACE_NAME);