mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 11:10:09 +01:00
libnm: canonicalize local/remote IP address in NMSettingVxlan
This commit is contained in:
parent
676fe327d4
commit
c7e55b232a
1 changed files with 15 additions and 4 deletions
|
|
@ -378,6 +378,19 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
_addrstr_set(char **dst, const char *src)
|
||||
{
|
||||
gs_free char *old = NULL;
|
||||
|
||||
old = *dst;
|
||||
if (!src)
|
||||
*dst = NULL;
|
||||
else if (!nm_utils_parse_inaddr(AF_UNSPEC, src, dst))
|
||||
*dst = g_strdup(src);
|
||||
}
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
|
|
@ -454,12 +467,10 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
|
|||
priv->id = g_value_get_uint(value);
|
||||
break;
|
||||
case PROP_LOCAL:
|
||||
g_free(priv->local);
|
||||
priv->local = g_value_dup_string(value);
|
||||
_addrstr_set(&priv->local, g_value_get_string(value));
|
||||
break;
|
||||
case PROP_REMOTE:
|
||||
g_free(priv->remote);
|
||||
priv->remote = g_value_dup_string(value);
|
||||
_addrstr_set(&priv->remote, g_value_get_string(value));
|
||||
break;
|
||||
case PROP_SOURCE_PORT_MIN:
|
||||
priv->source_port_min = g_value_get_uint(value);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue