starter: No special handling for left|rightsubnet, just pass it on as string.

This commit is contained in:
Tobias Brunner 2012-05-15 15:10:23 +02:00
parent 6ce841b213
commit eca839b0a7
4 changed files with 1 additions and 39 deletions

View File

@ -35,10 +35,8 @@ starter_cmp_end(starter_end_t *c1, starter_end_t *c2)
return FALSE;
VARCMP(ikeport);
VARCMP(has_client);
VARCMP(has_port_wildcard);
VARCMP(has_natip);
VARCMP(has_virt);
VARCMP(modecfg);
VARCMP(port);
VARCMP(protocol);
@ -53,7 +51,6 @@ starter_cmp_conn(starter_conn_t *c1, starter_conn_t *c2)
return FALSE;
VARCMP(policy);
VARCMP(tunnel_addr_family);
VARCMP(mark_in.value);
VARCMP(mark_in.mask);
VARCMP(mark_out.value);

View File

@ -31,8 +31,6 @@
#include "args.h"
#include "files.h"
/* strings containing a colon are interpreted as an IPv6 address */
#define ip_version(string) (strchr(string, '.') ? AF_INET : AF_INET6)
static const char ike_defaults[] = "aes128-sha1-modp2048,3des-sha1-modp1536";
static const char esp_defaults[] = "aes128-sha1-modp2048,3des-sha1-modp1536";
@ -93,7 +91,6 @@ static void default_values(starter_config_t *cfg)
cfg->conn_default.sa_rekey_margin = SA_REPLACEMENT_MARGIN_DEFAULT;
cfg->conn_default.sa_rekey_fuzz = SA_REPLACEMENT_FUZZ_DEFAULT;
cfg->conn_default.sa_keying_tries = SA_REPLACEMENT_RETRIES_DEFAULT;
cfg->conn_default.tunnel_addr_family = AF_INET;
cfg->conn_default.install_policy = TRUE;
cfg->conn_default.dpd_delay = 30; /* seconds */
cfg->conn_default.dpd_timeout = 150; /* seconds */
@ -184,35 +181,6 @@ static void kw_end(starter_conn_t *conn, starter_end_t *end, kw_token_t token,
free(end->host);
end->host = strdupnull(value);
break;
case KW_SUBNET:
if ((strlen(value) >= 6 && strncmp(value,"vhost:",6) == 0)
|| (strlen(value) >= 5 && strncmp(value,"vnet:",5) == 0))
{
/* used by pluto only */
end->has_virt = TRUE;
}
else
{
ip_subnet net;
char *pos;
int len = 0;
end->has_client = TRUE;
conn->tunnel_addr_family = ip_version(value);
pos = strchr(value, ',');
if (pos)
{
len = pos - value;
}
ugh = ttosubnet(value, len, ip_version(value), &net);
if (ugh != NULL)
{
DBG1(DBG_APP, "# bad subnet: %s=%s [%s]", name, value, ugh);
goto err;
}
}
break;
case KW_SOURCEIP:
if (end->has_natip)
{

View File

@ -73,10 +73,8 @@ struct starter_end {
char *host;
u_int ikeport;
char *subnet;
bool has_client;
bool has_port_wildcard;
bool has_natip;
bool has_virt;
bool modecfg;
certpolicy_t sendcert;
bool firewall;
@ -129,7 +127,6 @@ struct starter_conn {
mark_t mark_in;
mark_t mark_out;
u_int32_t tfc;
sa_family_t tunnel_addr_family;
bool install_policy;
bool aggressive;
starter_end_t left, right;

View File

@ -145,7 +145,7 @@ static void starter_stroke_add_end(stroke_msg_t *msg, stroke_end_t *msg_end, sta
msg_end->sourceip_mask = conn_end->sourceip_mask;
msg_end->sendcert = conn_end->sendcert;
msg_end->hostaccess = conn_end->hostaccess;
msg_end->tohost = !conn_end->has_client;
msg_end->tohost = !conn_end->subnet;
msg_end->allow_any = conn_end->allow_any;
msg_end->protocol = conn_end->protocol;
msg_end->port = conn_end->port;