Add FQDN support in the Connection Editor
Make the Connection Editor accept things that basically look like FQDNs Add quotation around the connection ID for wg-quick up/down Move the is_empty function to shared/
This commit is contained in:
1 parent
317e741e86
commit
013c65096c
4 files changed
+108
-21
No files matched your search
@@ -54,24 +54,6 @@ typedef struct {
|
||||
gboolean new_connection;
|
||||
} WireguardEditorPrivate;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
// check if the given string is NULL or empty
|
||||
static gboolean
|
||||
is_empty(const char *str)
|
||||
{
|
||||
gboolean empty = FALSE;
|
||||
gchar *tmp = g_strdup(str);
|
||||
tmp = g_strstrip(tmp);
|
||||
|
||||
if(!tmp || !tmp[0]){
|
||||
empty = TRUE;
|
||||
}
|
||||
|
||||
g_free(tmp);
|
||||
return empty;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
// functions for checking the contents of the input fields in the GUI
|
||||
|
||||
@@ -174,7 +156,7 @@ check_peer_allowed_ips(const char *str)
|
||||
static gboolean
|
||||
check_peer_endpoint(const char *str)
|
||||
{
|
||||
return is_ip4((char *)str) || is_ip6((char *)str);
|
||||
return is_ip4((char *)str) || is_ip6((char *)str) || is_fqdn((char *)str);
|
||||
}
|
||||
|
||||
// used in 'check()', matches the functions above
|
||||
|
||||
Reference in new issue
Block a user