From 20cc945383f19cd98191c10ba58acc8e596dc38d Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 1 Mar 2014 14:23:22 +0100 Subject: [PATCH] Warn when setting a default route the wrong way. --- src/config.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/config.c b/src/config.c index e7fca6ba..2bca6452 100644 --- a/src/config.c +++ b/src/config.c @@ -462,6 +462,13 @@ unsigned force_cert_auth; READ_MULTI_LINE("split-dns", config->split_dns, config->split_dns_size); READ_MULTI_LINE("route", config->network.routes, config->network.routes_size); + for (j=0;jnetwork.routes_size;j++) { + if (strstr(config->network.routes[j], "0.0.0.0/0") != 0) { + fprintf(stderr, "Illegal route '%s' detected; to set a default route remove all route directives\n", + config->network.routes[j]); + exit(1); + } + } READ_MULTI_LINE("dns", config->network.dns, config->network.dns_size); if (config->network.dns_size == 0) { /* try the aliases */