allow specifying a subnet id

This commit is contained in:
Nikos Mavrogiannopoulos
2015-05-07 08:57:58 +02:00
parent acde2a1163
commit 689c5ad563
3 changed files with 11 additions and 0 deletions

View File

@@ -163,6 +163,7 @@ static struct cfg_options available_options[] = {
{ .name = "ipv6-network", .type = OPTION_STRING, .mandatory = 0 },
{ .name = "ipv6-prefix", .type = OPTION_NUMERIC, .mandatory = 0 },
{ .name = "ipv6-subnet-id-length", .type = OPTION_NUMERIC, .mandatory = 0 },
{ .name = "route-add-cmd", .type = OPTION_STRING, .mandatory = 0 },
{ .name = "route-del-cmd", .type = OPTION_STRING, .mandatory = 0 },
{ .name = "config-per-user", .type = OPTION_STRING, .mandatory = 0 },
@@ -886,6 +887,9 @@ unsigned urlfw_size = 0;
}
READ_STRING("ipv6-network", config->network.ipv6);
READ_NUMERIC("ipv6-subnet-id-length", config->network.ipv6_subnet_id_length);
if (config->network.ipv6_subnet_id_length == 0)
config->network.ipv6_subnet_id_length = DEFAULT_SUBNET_ID_LENGTH;
prefix = extract_prefix(config->network.ipv6);
if (prefix == 0) {

View File

@@ -450,6 +450,11 @@ ipv4-netmask = 255.255.255.0
# The IPv6 subnet that leases will be given from.
#ipv6-network = fda9:4efe:7e3b:03ea::/64
# The length, in bits, of the subnet id to give addresses to clients.
# This also defines the maximum number of clients the server can handle,
# i.e., 2^(length).
#ipv6-subnet-id-length = 16
# The advertized DNS server. Use multiple lines for
# multiple servers.
# dns = fc00::4be0

View File

@@ -66,6 +66,7 @@ typedef enum {
#define DEFAULT_KKDCP_POINTS 1
#define DEFAULT_MAX_BAN_SCORE (MAX_PASSWORD_TRIES*DEFAULT_PASSWORD_POINTS)
#define DEFAULT_BAN_RESET_TIME 300
#define DEFAULT_SUBNET_ID_LENGTH 16
#define MIN_NO_COMPRESS_LIMIT 64
#define DEFAULT_NO_COMPRESS_LIMIT 256
@@ -218,6 +219,7 @@ struct vpn_st {
char *ipv6;
char *ipv6_local; /* local IPv6 address */
unsigned ipv6_subnet_id_length;
unsigned int mtu;
char **routes;