starter: No special handling for left|rightsubnet, just pass it on as string.
authorTobias Brunner <tobias@strongswan.org>
Tue, 15 May 2012 13:10:23 +0000 (15:10 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 11 Jun 2012 15:33:31 +0000 (17:33 +0200)
src/starter/cmp.c
src/starter/confread.c
src/starter/confread.h
src/starter/starterstroke.c

index 6713a91..68890b1 100644 (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);
index 8f34e1e..b401aa7 100644 (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)
                {
index 7fa27cc..04a8e36 100644 (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;
index e39581c..34cfca0 100644 (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;