diff options
Diffstat (limited to 'src/libnm-core-impl')
| -rw-r--r-- | src/libnm-core-impl/nm-setting-connection.c | 47 | ||||
| -rw-r--r-- | src/libnm-core-impl/nm-setting-ip-config.c | 12 | ||||
| -rw-r--r-- | src/libnm-core-impl/tests/test-general.c | 6 |
3 files changed, 34 insertions, 31 deletions
diff --git a/src/libnm-core-impl/nm-setting-connection.c b/src/libnm-core-impl/nm-setting-connection.c index 0d307be3..cbce1c12 100644 --- a/src/libnm-core-impl/nm-setting-connection.c +++ b/src/libnm-core-impl/nm-setting-connection.c @@ -1402,19 +1402,6 @@ after_interface_name: } else { guint32 f; - if (NM_FLAGS_ALL(priv->mptcp_flags, - NM_MPTCP_FLAGS_ENABLED_ON_GLOBAL_IFACE | NM_MPTCP_FLAGS_ENABLED)) { - g_set_error_literal( - error, - NM_CONNECTION_ERROR, - NM_CONNECTION_ERROR_INVALID_PROPERTY, - _("\"enabled\" and \"enabled-on-global-iface\" flag cannot be set together")); - g_prefix_error(error, - "%s.%s: ", - NM_SETTING_CONNECTION_SETTING_NAME, - NM_SETTING_CONNECTION_MPTCP_FLAGS); - return FALSE; - } if (NM_FLAGS_ALL(priv->mptcp_flags, NM_MPTCP_FLAGS_SIGNAL | NM_MPTCP_FLAGS_FULLMESH)) { g_set_error_literal(error, NM_CONNECTION_ERROR, @@ -1426,8 +1413,7 @@ after_interface_name: NM_SETTING_CONNECTION_MPTCP_FLAGS); return FALSE; } - f = NM_FLAGS_UNSET(priv->mptcp_flags, NM_MPTCP_FLAGS_ENABLED_ON_GLOBAL_IFACE) - | ((guint32) NM_MPTCP_FLAGS_ENABLED); + f = priv->mptcp_flags | ((guint32) NM_MPTCP_FLAGS_ENABLED); if (f != nm_mptcp_flags_normalize(f)) { g_set_error(error, NM_CONNECTION_ERROR, @@ -2608,21 +2594,30 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass) * If "disabled" (0x1), MPTCP handling for the interface is disabled and * no endpoints are registered. * - * The flag "enabled-on-global-iface" (0x2) means that MPTCP handling is enabled - * if the interface configures a default route in the main routing table. - * This choice is per-address family, for example if there is an IPv4 default route - * 0.0.0.0/0, IPv4 endpoints are configured. - * - * The "enabled" (0x4) flag means that MPTCP handling is explicitly enabled. + * The "enabled" (0x2) flag means that MPTCP handling is enabled. * This flag can also be implied from the presence of other flags. * - * If MPTCP handling is enabled, then endpoints will be configured - * with the specified address flags "signal" (0x10), "subflow" (0x20), "backup" (0x40), + * Even when enabled, MPTCP handling will by default still be disabled + * unless "/proc/sys/net/mptcp/enabled" sysctl is on. NetworkManager + * does not change the sysctl and this is up to the administrator + * or distribution. To configure endpoints even if the sysctl is + * disabled, "also-without-sysctl" (0x4) flag can be used. In that case, + * NetworkManager doesn't look at the sysctl and configures endpoints + * regardless. + * + * Even when enabled, NetworkManager will only configure MPTCP endpoints + * for a certain address family, if there is a unicast default route (0.0.0.0/0 + * or ::/0) in the main routing table. The flag "also-without-default-route" + * (0x8) can override that. + * + * When MPTCP handling is enabled then endpoints are configured with + * the specified address flags "signal" (0x10), "subflow" (0x20), "backup" (0x40), * "fullmesh" (0x80). See ip-mptcp(8) manual for additional information about the flags. * - * If the flags are zero, the global connection default from NetworkManager.conf is - * honored. If still unspecified, the fallback is either "disabled" or - * "enabled-on-global-iface,subflow" depending on "/proc/sys/net/mptcp/enabled". + * If the flags are zero (0x0), the global connection default from NetworkManager.conf is + * honored. If still unspecified, the fallback is "enabled,subflow". + * Note that this means that MPTCP is by default done depending on the + * "/proc/sys/net/mptcp/enabled" sysctl. * * NetworkManager does not change the MPTCP limits nor enable MPTCP via * "/proc/sys/net/mptcp/enabled". That is a host configuration which the diff --git a/src/libnm-core-impl/nm-setting-ip-config.c b/src/libnm-core-impl/nm-setting-ip-config.c index ab760c4e..916a8038 100644 --- a/src/libnm-core-impl/nm-setting-ip-config.c +++ b/src/libnm-core-impl/nm-setting-ip-config.c @@ -6304,12 +6304,14 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass) * The gateway associated with this configuration. This is only meaningful * if #NMSettingIPConfig:addresses is also set. * - * The gateway's main purpose is to control the next hop of the standard default route on the device. - * Hence, the gateway property conflicts with #NMSettingIPConfig:never-default and will be - * automatically dropped if the IP configuration is set to never-default. + * Setting the gateway causes NetworkManager to configure a standard default route + * with the gateway as next hop. This is ignored if #NMSettingIPConfig:never-default + * is set. An alternative is to configure the default route explicitly with a manual + * route and /0 as prefix length. * - * As an alternative to set the gateway, configure a static default route with /0 as prefix - * length. + * Note that the gateway usually conflicts with routing that NetworkManager configures + * for WireGuard interfaces, so usually it should not be set in that case. See + * #NMSettingWireGuard:ip4-auto-default-route. **/ obj_properties[PROP_GATEWAY] = g_param_spec_string( NM_SETTING_IP_CONFIG_GATEWAY, diff --git a/src/libnm-core-impl/tests/test-general.c b/src/libnm-core-impl/tests/test-general.c index 3c8cd3ba..64b3dca7 100644 --- a/src/libnm-core-impl/tests/test-general.c +++ b/src/libnm-core-impl/tests/test-general.c @@ -9124,6 +9124,10 @@ test_nm_utils_enum(void) .value = 5, }, { + .nick = "nick-0", + .value = 0, + }, + { .nick = "nick-red", .value = NM_TEST_GENERAL_COLOR_FLAGS_RED, }, @@ -9170,6 +9174,8 @@ test_nm_utils_enum(void) "nick-5, green", color_value_infos); + _test_nm_utils_enum_to_str_do_full(color_flags, 0, "nick-0", color_value_infos); + _test_nm_utils_enum_from_str_do(bool_enum, "", FALSE, 0, NULL); _test_nm_utils_enum_from_str_do(bool_enum, " ", FALSE, 0, NULL); _test_nm_utils_enum_from_str_do(bool_enum, "invalid", FALSE, 0, "invalid"); |