Don't initialize the 'vs' interface by default

This commit is contained in:
Robert Swiecki 2016-02-29 17:50:25 +01:00
parent 4bab84fbcf
commit af6a6bb2dc
2 changed files with 6 additions and 2 deletions

View File

@ -284,7 +284,7 @@ bool cmdlineParse(int argc, char *argv[], struct nsjconf_t * nsjconf)
.mount_proc = true, .mount_proc = true,
.iface_no_lo = false, .iface_no_lo = false,
.iface = NULL, .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_nm = "255.255.255.0",
.iface_vs_gw = "0.0.0.0", .iface_vs_gw = "0.0.0.0",
}; };

6
net.c
View File

@ -312,6 +312,11 @@ bool netConfigureVs(struct nsjconf_t * nsjconf)
close(sock); close(sock);
return false; 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); struct sockaddr_in *sa = (struct sockaddr_in *)(&ifr.ifr_addr);
sa->sin_family = AF_INET; sa->sin_family = AF_INET;
sa->sin_addr = addr; sa->sin_addr = addr;
@ -343,7 +348,6 @@ bool netConfigureVs(struct nsjconf_t * nsjconf)
close(sock); close(sock);
return false; return false;
} }
if (addr.s_addr == INADDR_ANY) { if (addr.s_addr == INADDR_ANY) {
LOG_I("Gateway address for '%s' is 0.0.0.0. Not adding the default route", LOG_I("Gateway address for '%s' is 0.0.0.0. Not adding the default route",
IFACE_NAME); IFACE_NAME);