]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
charon-nm: Allow using fixed source ports
authorTobias Brunner <tobias@strongswan.org>
Thu, 26 Mar 2020 07:55:36 +0000 (08:55 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 27 Mar 2020 13:25:38 +0000 (14:25 +0100)
This could be useful in cases a client behind a NAT has to be made reachable
via port forwarding.

Closes strongswan/strongswan#166.

src/charon-nm/charon-nm.c

index 0134f5a71d8bfce9fde19edd8daca14d09c7a9ed..1aa975efb6eaf287d1994e8c7d7a8ae7da716f52 100644 (file)
@@ -196,9 +196,9 @@ int main(int argc, char *argv[])
                                                           "charon-nm.syslog.daemon.default", 1));
        charon->load_loggers(charon);
 
-       /* use random ports to avoid conflicts with regular charon */
-       lib->settings->set_int(lib->settings, "charon-nm.port", 0);
-       lib->settings->set_int(lib->settings, "charon-nm.port_nat_t", 0);
+       /* default to random ports to avoid conflicts with regular charon */
+       lib->settings->set_default_str(lib->settings, "charon-nm.port", "0");
+       lib->settings->set_default_str(lib->settings, "charon-nm.port_nat_t", "0");
 
        DBG1(DBG_DMN, "Starting charon NetworkManager backend (strongSwan "VERSION")");
        if (lib->integrity)