disallow zero interface addresses in config

closes #538

Change-Id: I27278125e0f15e4cd860380592606adbcfd0f6b7
changes/44/20944/4
Richard Fuchs 8 years ago
parent 93555d76d0
commit 43f2971722

@ -164,11 +164,15 @@ static struct intf_config *if_addr_parse(char *s) {
/* address */ /* address */
if (sockaddr_parse_any(&addr, s)) if (sockaddr_parse_any(&addr, s))
return NULL; return NULL;
if (is_addr_unspecified(&addr))
return NULL;
adv = addr; adv = addr;
if (c) { if (c) {
if (sockaddr_parse_any(&adv, c)) if (sockaddr_parse_any(&adv, c))
return NULL; return NULL;
if (is_addr_unspecified(&adv))
return NULL;
} }
ifa = g_slice_alloc0(sizeof(*ifa)); ifa = g_slice_alloc0(sizeof(*ifa));
@ -317,6 +321,8 @@ static void options(int *argc, char ***argv) {
die("Invalid interface specification: %s", *iter); die("Invalid interface specification: %s", *iter);
g_queue_push_tail(&rtpe_config.interfaces, ifa); g_queue_push_tail(&rtpe_config.interfaces, ifa);
} }
if (!&rtpe_config.interfaces)
die("Cannot start without any configured interfaces");
if (ks_a) { if (ks_a) {
for (iter = ks_a; *iter; iter++) { for (iter = ks_a; *iter; iter++) {

Loading…
Cancel
Save