ike-cfg: remove the to be obsoleted allow any parameter in get_my/other_addr
authorMartin Willi <martin@revosec.ch>
Thu, 25 Jul 2013 12:07:40 +0000 (14:07 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Sep 2013 08:38:37 +0000 (10:38 +0200)
src/libcharon/config/backend_manager.c
src/libcharon/config/ike_cfg.c
src/libcharon/config/ike_cfg.h
src/libcharon/plugins/smp/smp.c
src/libcharon/plugins/stroke/stroke_config.c
src/libcharon/plugins/stroke/stroke_list.c
src/libcharon/sa/ike_sa.c

index ca25051..79f1d9f 100644 (file)
@@ -135,7 +135,6 @@ METHOD(backend_manager_t, get_ike_cfg, ike_cfg_t*,
 {
        ike_cfg_t *current, *found = NULL;
        char *my_addr, *other_addr;
-       bool my_allow_any, other_allow_any;
        enumerator_t *enumerator;
        ike_cfg_match_t match, best = MATCH_ANY;
        ike_data_t *data;
@@ -159,11 +158,10 @@ METHOD(backend_manager_t, get_ike_cfg, ike_cfg_t*,
                         match, me, other, ike_version_names, version);
                if (match)
                {
-                       my_addr = current->get_my_addr(current, &my_allow_any);
-                       other_addr = current->get_other_addr(current, &other_allow_any);
-                       DBG2(DBG_CFG, "  candidate: %s%s...%s%s, prio %d",
-                                                 my_allow_any ? "%":"", my_addr,
-                                                 other_allow_any ? "%":"", other_addr, match);
+                       my_addr = current->get_my_addr(current);
+                       other_addr = current->get_other_addr(current);
+                       DBG2(DBG_CFG, "  candidate: %s...%s, prio %d",
+                                my_addr, other_addr, match);
                        if (match > best)
                        {
                                DESTROY_IF(found);
@@ -177,11 +175,10 @@ METHOD(backend_manager_t, get_ike_cfg, ike_cfg_t*,
        this->lock->unlock(this->lock);
        if (found)
        {
-               my_addr = found->get_my_addr(found, &my_allow_any);
-               other_addr = found->get_other_addr(found, &other_allow_any);
-               DBG2(DBG_CFG, "found matching ike config: %s%s...%s%s with prio %d",
-                                         my_allow_any ? "%":"", my_addr,
-                                         other_allow_any ? "%":"", other_addr, best);
+               my_addr = found->get_my_addr(found);
+               other_addr = found->get_other_addr(found);
+               DBG2(DBG_CFG, "found matching ike config: %s...%s with prio %d",
+                        my_addr, other_addr, best);
        }
        return found;
 }
index 0fffd2b..572f1f9 100644 (file)
@@ -186,22 +186,14 @@ METHOD(ike_cfg_t, match_other, u_int,
 }
 
 METHOD(ike_cfg_t, get_my_addr, char*,
-       private_ike_cfg_t *this, bool *allow_any)
+       private_ike_cfg_t *this)
 {
-       if (allow_any)
-       {
-               *allow_any = this->my_allow_any;
-       }
        return this->me;
 }
 
 METHOD(ike_cfg_t, get_other_addr, char*,
-       private_ike_cfg_t *this, bool *allow_any)
+       private_ike_cfg_t *this)
 {
-       if (allow_any)
-       {
-               *allow_any = this->other_allow_any;
-       }
        return this->other;
 }
 
index 6e0d051..0540e93 100644 (file)
@@ -112,18 +112,16 @@ struct ike_cfg_t {
        /**
         * Get own address.
         *
-        * @param allow_any             allow any address to match
         * @return                              string of address/DNS name
         */
-       char* (*get_my_addr) (ike_cfg_t *this, bool *allow_any);
+       char* (*get_my_addr) (ike_cfg_t *this);
 
        /**
         * Get peer's address.
         *
-        * @param allow_any             allow any address to match
         * @return                              string of address/DNS name
         */
-       char* (*get_other_addr) (ike_cfg_t *this, bool *allow_any);
+       char* (*get_other_addr) (ike_cfg_t *this);
 
        /**
         * Get the port to use as our source port.
index a92e571..7bc1700 100644 (file)
@@ -309,9 +309,9 @@ static void request_query_config(xmlTextReaderPtr reader, xmlTextWriterPtr write
                ike_cfg = peer_cfg->get_ike_cfg(peer_cfg);
                xmlTextWriterStartElement(writer, "ikeconfig");
                xmlTextWriterWriteElement(writer, "local",
-                                                                 ike_cfg->get_my_addr(ike_cfg, NULL));
+                                                                 ike_cfg->get_my_addr(ike_cfg));
                xmlTextWriterWriteElement(writer, "remote",
-                                                                 ike_cfg->get_other_addr(ike_cfg, NULL));
+                                                                 ike_cfg->get_other_addr(ike_cfg));
                xmlTextWriterEndElement(writer);
                /* </ikeconfig> */
 
index 2e36ce3..1ab32af 100644 (file)
@@ -824,7 +824,7 @@ static peer_cfg_t *build_peer_cfg(private_stroke_config_t *this,
                                }
                                else
                                {
-                                       if (strchr(ike_cfg->get_my_addr(ike_cfg, NULL), ':'))
+                                       if (strchr(ike_cfg->get_my_addr(ike_cfg), ':'))
                                        {
                                                vip = host_create_any(AF_INET6);
                                        }
index 7431514..a788ce5 100644 (file)
@@ -555,10 +555,8 @@ METHOD(stroke_list_t, status, void,
                        ike_version = peer_cfg->get_ike_version(peer_cfg);
                        my_addr = ike_cfg->get_my_addr(ike_cfg, &my_allow_any);
                        other_addr = ike_cfg->get_other_addr(ike_cfg, &other_allow_any);
-                       fprintf(out, "%12s:  %s%s...%s%s  %N", peer_cfg->get_name(peer_cfg),
-                                       my_allow_any ? "%":"", my_addr,
-                                       other_allow_any ? "%":"", other_addr,
-                                       ike_version_names, ike_version);
+                       fprintf(out, "%12s:  %s...%s  %N", peer_cfg->get_name(peer_cfg),
+                                       my_addr, other_addr, ike_version_names, ike_version);
 
                        if (ike_version == IKEV1 && peer_cfg->use_aggressive(peer_cfg))
                        {
index b640793..2015708 100644 (file)
@@ -1166,7 +1166,7 @@ METHOD(ike_sa_t, initiate, status_t,
                        host_t *host;
                        char *addr;
 
-                       addr = this->ike_cfg->get_my_addr(this->ike_cfg, NULL);
+                       addr = this->ike_cfg->get_my_addr(this->ike_cfg);
                        host = this->ike_cfg->resolve_other(this->ike_cfg, AF_UNSPEC);
                        is_anyaddr = host && host->is_anyaddr(host);
                        DESTROY_IF(host);