mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-14 02:22:03 +08:00
print errors when an invalid IPv6 prefix is found.
This commit is contained in:
@@ -420,6 +420,11 @@ unsigned force_cert_auth;
|
|||||||
if (prefix > 0) {
|
if (prefix > 0) {
|
||||||
config->network.ipv6_netmask = ipv6_prefix_to_mask(prefix);
|
config->network.ipv6_netmask = ipv6_prefix_to_mask(prefix);
|
||||||
config->network.ipv6_prefix = prefix;
|
config->network.ipv6_prefix = prefix;
|
||||||
|
|
||||||
|
if (config->network.ipv6_netmask == NULL) {
|
||||||
|
fprintf(stderr, "invalid IPv6 prefix: %u\n", prefix);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
READ_MULTI_LINE("custom-header", config->custom_header, config->custom_header_size);
|
READ_MULTI_LINE("custom-header", config->custom_header, config->custom_header_size);
|
||||||
|
|||||||
@@ -172,6 +172,10 @@ unsigned prefix = 0;
|
|||||||
if (prefix > 0) {
|
if (prefix > 0) {
|
||||||
config->ipv6_netmask = ipv6_prefix_to_mask(prefix);
|
config->ipv6_netmask = ipv6_prefix_to_mask(prefix);
|
||||||
config->ipv6_prefix = prefix;
|
config->ipv6_prefix = prefix;
|
||||||
|
|
||||||
|
if (config->ipv6_netmask == NULL) {
|
||||||
|
mslog(s, NULL, LOG_ERR, "unknown ipv6-prefix '%u' in %s", prefix, file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
READ_RAW_NUMERIC("rx-data-per-sec", config->rx_per_sec);
|
READ_RAW_NUMERIC("rx-data-per-sec", config->rx_per_sec);
|
||||||
|
|||||||
Reference in New Issue
Block a user