mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-18 14:10:33 +01:00
libnm,core: allow VXLAN connections without an explicit remote VTEP
[thaller@redhat.com: squashed commits, resolve merge conflict and coding style] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/645
This commit is contained in:
parent
e29f00fa0c
commit
676fe327d4
2 changed files with 22 additions and 24 deletions
|
|
@ -315,27 +315,23 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
|
|||
NMSettingVxlanPrivate *priv = NM_SETTING_VXLAN_GET_PRIVATE(setting);
|
||||
int family = AF_UNSPEC;
|
||||
|
||||
if (!priv->remote) {
|
||||
g_set_error_literal(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_MISSING_PROPERTY,
|
||||
_("property is missing"));
|
||||
g_prefix_error(error, "%s.%s: ", NM_SETTING_VXLAN_SETTING_NAME, NM_SETTING_VXLAN_REMOTE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (nm_utils_ipaddr_is_valid(AF_INET, priv->remote))
|
||||
family = AF_INET;
|
||||
else if (nm_utils_ipaddr_is_valid(AF_INET6, priv->remote))
|
||||
family = AF_INET6;
|
||||
else {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("'%s' is not a valid IP address"),
|
||||
priv->remote);
|
||||
g_prefix_error(error, "%s.%s: ", NM_SETTING_VXLAN_SETTING_NAME, NM_SETTING_VXLAN_REMOTE);
|
||||
return FALSE;
|
||||
if (priv->remote) {
|
||||
if (nm_utils_ipaddr_is_valid(AF_INET, priv->remote))
|
||||
family = AF_INET;
|
||||
else if (nm_utils_ipaddr_is_valid(AF_INET6, priv->remote))
|
||||
family = AF_INET6;
|
||||
else {
|
||||
g_set_error(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("'%s' is not a valid IP address"),
|
||||
priv->remote);
|
||||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
NM_SETTING_VXLAN_SETTING_NAME,
|
||||
NM_SETTING_VXLAN_REMOTE);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (priv->local) {
|
||||
|
|
|
|||
|
|
@ -180,9 +180,11 @@ create_and_realize(NMDevice * device,
|
|||
}
|
||||
|
||||
str = nm_setting_vxlan_get_remote(s_vxlan);
|
||||
if (!nm_utils_parse_inaddr_bin(AF_INET, str, NULL, &props.group)
|
||||
&& !nm_utils_parse_inaddr_bin(AF_INET6, str, NULL, &props.group6))
|
||||
return FALSE;
|
||||
if (str) {
|
||||
if (!nm_utils_parse_inaddr_bin(AF_INET, str, NULL, &props.group)
|
||||
&& !nm_utils_parse_inaddr_bin(AF_INET6, str, NULL, &props.group6))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
props.tos = nm_setting_vxlan_get_tos(s_vxlan);
|
||||
props.ttl = nm_setting_vxlan_get_ttl(s_vxlan);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue