X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fconf.c;fp=src%2Fconf.c;h=16247570c25cc617ffe2e78f8808ca0f76e771a0;hb=1c1ea3e501944f1e49cb65add689d9cd6dea8af6;hp=95c07477da9c8575825d34718febb30c3b333f15;hpb=7f7b53dc2011fc8ceda1e0678d9f78b1dbd8c1d1;p=meshlink diff --git a/src/conf.c b/src/conf.c index 95c07477..16247570 100644 --- a/src/conf.c +++ b/src/conf.c @@ -29,7 +29,6 @@ #include "conf.h" #include "list.h" #include "logger.h" -#include "names.h" #include "netutl.h" /* for str2address */ #include "protocol.h" #include "utils.h" /* for cp */ @@ -187,34 +186,6 @@ bool get_config_address(const config_t *cfg, struct addrinfo **result) { return false; } -bool get_config_subnet(const config_t *cfg, subnet_t ** result) { - subnet_t subnet = {NULL}; - - if(!cfg) - return false; - - if(!str2net(&subnet, cfg->value)) { - logger(DEBUG_ALWAYS, LOG_ERR, "Subnet expected for configuration variable %s in %s line %d", - cfg->variable, cfg->file, cfg->line); - return false; - } - - /* Teach newbies what subnets are... */ - - if(((subnet.type == SUBNET_IPV4) - && !maskcheck(&subnet.net.ipv4.address, subnet.net.ipv4.prefixlength, sizeof subnet.net.ipv4.address)) - || ((subnet.type == SUBNET_IPV6) - && !maskcheck(&subnet.net.ipv6.address, subnet.net.ipv6.prefixlength, sizeof subnet.net.ipv6.address))) { - logger(DEBUG_ALWAYS, LOG_ERR, "Network address and prefix length do not match for configuration variable %s in %s line %d", - cfg->variable, cfg->file, cfg->line); - return false; - } - - *(*result = new_subnet()) = subnet; - - return true; -} - /* Read exactly one line and strip the trailing newline if any. */