charon-nm: Add support for custom server ports
authorTobias Brunner <tobias@strongswan.org>
Thu, 19 Dec 2019 13:40:11 +0000 (14:40 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 14 Feb 2020 12:36:16 +0000 (13:36 +0100)
src/charon-nm/nm/nm_service.c

index fcf79fa..706e482 100644 (file)
@@ -447,6 +447,11 @@ static gboolean connect_(NMVpnServicePlugin *plugin, NMConnection *connection,
                                        "Gateway address missing.");
                return FALSE;
        }
+       str = nm_setting_vpn_get_data_item(vpn, "server-port");
+       if (str && strlen(str))
+       {
+               ike.remote_port = settings_value_as_int((char*)str, ike.remote_port);
+       }
        str = nm_setting_vpn_get_data_item(vpn, "virtual");
        virtual = streq(str, "yes");
        str = nm_setting_vpn_get_data_item(vpn, "encap");