diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/devices/nm-device.c | 3 | ||||
| -rw-r--r-- | src/core/devices/ovs/nm-device-ovs-port.c | 57 | ||||
| -rw-r--r-- | src/core/nm-l3cfg.c | 4 | ||||
| -rw-r--r-- | src/libnm-core-public/nm-version-macros.h | 4 | ||||
| -rw-r--r-- | src/libnm-platform/nm-platform.c | 2 | ||||
| -rw-r--r-- | src/libnm-platform/wifi/nm-wifi-utils-nl80211.c | 8 | ||||
| -rw-r--r-- | src/libnm-platform/wifi/nm-wifi-utils-wext.c | 10 | ||||
| -rw-r--r-- | src/nmcli/connections.c | 7 |
8 files changed, 73 insertions, 22 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index aed580ab..35360cee 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -15076,8 +15076,7 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu if (ifindex > 0) { NMPlatform *platform = nm_device_get_platform(self); - nm_platform_ip_route_flush(platform, AF_UNSPEC, ifindex); - nm_platform_ip_address_flush(platform, AF_UNSPEC, ifindex); + nm_device_l3cfg_commit(self, NM_L3_CFG_COMMIT_TYPE_REAPPLY, TRUE); if (nm_device_get_applied_setting(self, NM_TYPE_SETTING_TC_CONFIG)) { nm_platform_tc_sync(platform, ifindex, NULL, NULL); diff --git a/src/core/devices/ovs/nm-device-ovs-port.c b/src/core/devices/ovs/nm-device-ovs-port.c index 4419cfe9..8406c364 100644 --- a/src/core/devices/ovs/nm-device-ovs-port.c +++ b/src/core/devices/ovs/nm-device-ovs-port.c @@ -15,7 +15,8 @@ #include "nm-active-connection.h" #include "nm-setting-connection.h" #include "nm-setting-ovs-port.h" -#include "nm-setting-ovs-port.h" +#include "nm-setting-ovs-interface.h" +#include "nm-setting-wired.h" #define _NMLOG_DEVICE_TYPE NMDeviceOvsPort #include "devices/nm-device-logging.h" @@ -88,12 +89,40 @@ add_iface_cb(GError *error, gpointer user_data) } static gboolean +_ovs_interface_is_dpdk(NMDevice *device) +{ + NMSettingOvsInterface *s_ovs_iface; + + s_ovs_iface = nm_device_get_applied_setting(device, NM_TYPE_SETTING_OVS_INTERFACE); + + g_return_val_if_fail(s_ovs_iface, FALSE); + + return nm_streq(nm_setting_ovs_interface_get_interface_type(s_ovs_iface), "dpdk"); +} + +static void +set_mtu_cb(GError *error, gpointer user_data) +{ + NMDevice *self = user_data; + + if (error && !g_error_matches(error, NM_UTILS_ERROR, NM_UTILS_ERROR_CANCELLED_DISPOSING)) { + _LOGW(LOGD_DEVICE, + "could not change mtu of '%s': %s", + nm_device_get_iface(self), + error->message); + } + + g_object_unref(self); +} + +static gboolean enslave_slave(NMDevice *device, NMDevice *slave, NMConnection *connection, gboolean configure) { NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT(device); NMActiveConnection *ac_port = NULL; NMActiveConnection *ac_bridge = NULL; NMDevice *bridge_device; + NMSettingWired *s_wired; if (!configure) return TRUE; @@ -122,6 +151,21 @@ enslave_slave(NMDevice *device, NMDevice *slave, NMConnection *connection, gbool add_iface_cb, g_object_ref(slave)); + /* DPDK ports does not have a link after the devbind, so the MTU must be + * set on ovsdb after adding the interface. */ + if (NM_IS_DEVICE_OVS_INTERFACE(slave) && _ovs_interface_is_dpdk(slave)) { + s_wired = nm_device_get_applied_setting(slave, NM_TYPE_SETTING_WIRED); + + if (!s_wired || !nm_setting_wired_get_mtu(s_wired)) + return TRUE; + + nm_ovsdb_set_interface_mtu(nm_ovsdb_get(), + nm_device_get_ip_iface(slave), + nm_setting_wired_get_mtu(s_wired), + set_mtu_cb, + g_object_ref(slave)); + } + return TRUE; } @@ -145,6 +189,7 @@ static void release_slave(NMDevice *device, NMDevice *slave, gboolean configure) { NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT(device); + bool slave_removed = nm_device_sys_iface_state_get(slave) == NM_DEVICE_SYS_IFACE_STATE_REMOVED; _LOGI(LOGD_DEVICE, "releasing ovs interface %s", nm_device_get_ip_iface(slave)); @@ -152,10 +197,12 @@ release_slave(NMDevice *device, NMDevice *slave, gboolean configure) * removed and thus we're called with configure=FALSE), we still need * to make sure its OVSDB entry is gone. */ - nm_ovsdb_del_interface(nm_ovsdb_get(), - nm_device_get_iface(slave), - del_iface_cb, - g_object_ref(slave)); + if (configure || slave_removed) { + nm_ovsdb_del_interface(nm_ovsdb_get(), + nm_device_get_iface(slave), + del_iface_cb, + g_object_ref(slave)); + } if (configure) { /* Open VSwitch is going to delete this one. We must ignore what happens diff --git a/src/core/nm-l3cfg.c b/src/core/nm-l3cfg.c index 7d00264b..eeb041d0 100644 --- a/src/core/nm-l3cfg.c +++ b/src/core/nm-l3cfg.c @@ -917,7 +917,9 @@ _obj_states_externally_removed_track(NML3Cfg *self, const NMPObject *obj, gboole return; } - nm_assert(c_list_is_empty(&obj_state->os_zombie_lst)); + /* Even if this is a zombie (os_zombie_lst), it is still in platform. We continue + * tracking it, until it gets deleted from platform or until the os_zombie_count + * drops to zero. We don't need to handle this specially here. */ if (in_platform) { nmp_object_ref_set(&obj_state->os_plobj, obj); diff --git a/src/libnm-core-public/nm-version-macros.h b/src/libnm-core-public/nm-version-macros.h index 25d432ad..7e9ff61b 100644 --- a/src/libnm-core-public/nm-version-macros.h +++ b/src/libnm-core-public/nm-version-macros.h @@ -22,7 +22,7 @@ * Evaluates to the minor version number of NetworkManager which this source * is compiled against. */ -#define NM_MINOR_VERSION (35) +#define NM_MINOR_VERSION (36) /** * NM_MICRO_VERSION: @@ -30,7 +30,7 @@ * Evaluates to the micro version number of NetworkManager which this source * compiled against. */ -#define NM_MICRO_VERSION (92) +#define NM_MICRO_VERSION (0) /** * NM_CHECK_VERSION: diff --git a/src/libnm-platform/nm-platform.c b/src/libnm-platform/nm-platform.c index b95cd95e..922f412d 100644 --- a/src/libnm-platform/nm-platform.c +++ b/src/libnm-platform/nm-platform.c @@ -8966,6 +8966,8 @@ finalize(GObject *object) g_clear_object(&self->_netns); nm_dedup_multi_index_unref(priv->multi_idx); nmp_cache_free(priv->cache); + + G_OBJECT_CLASS(nm_platform_parent_class)->finalize(object); } static void diff --git a/src/libnm-platform/wifi/nm-wifi-utils-nl80211.c b/src/libnm-platform/wifi/nm-wifi-utils-nl80211.c index 2fa46e38..3906384b 100644 --- a/src/libnm-platform/wifi/nm-wifi-utils-nl80211.c +++ b/src/libnm-platform/wifi/nm-wifi-utils-nl80211.c @@ -382,12 +382,12 @@ wifi_nl80211_find_freq(NMWifiUtils *data, const guint32 *freqs) { NMWifiUtilsNl80211 *self = (NMWifiUtilsNl80211 *) data; int i; + int j; for (i = 0; i < self->num_freqs; i++) { - while (*freqs) { - if (self->freqs[i] == *freqs) - return *freqs; - freqs++; + for (j = 0; freqs[j] != 0; j++) { + if (self->freqs[i] == freqs[j]) + return freqs[j]; } } return 0; diff --git a/src/libnm-platform/wifi/nm-wifi-utils-wext.c b/src/libnm-platform/wifi/nm-wifi-utils-wext.c index 2d4112bc..8d0e6ed0 100644 --- a/src/libnm-platform/wifi/nm-wifi-utils-wext.c +++ b/src/libnm-platform/wifi/nm-wifi-utils-wext.c @@ -252,13 +252,13 @@ static guint32 wifi_wext_find_freq(NMWifiUtils *data, const guint32 *freqs) { NMWifiUtilsWext *wext = (NMWifiUtilsWext *) data; - int i; + guint i; + guint j; for (i = 0; i < wext->num_freqs; i++) { - while (*freqs) { - if (wext->freqs[i] == *freqs) - return *freqs; - freqs++; + for (j = 0; freqs[j] != 0; j++) { + if (wext->freqs[i] == freqs[j]) + return freqs[j]; } } return 0; diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c index 5a66b82f..559dc7db 100644 --- a/src/nmcli/connections.c +++ b/src/nmcli/connections.c @@ -4189,6 +4189,7 @@ set_option(NmCli *nmc, NMConnection *connection, const NMMetaAbstractInfo *abstract_info, const char *value, + gboolean allow_reset, GError **error) { const char *setting_name, *property_name, *option_name; @@ -4209,7 +4210,7 @@ set_option(NmCli *nmc, NULL); if (option && option->check_and_set) { return option->check_and_set(nmc, connection, option, value, error); - } else { + } else if (value || allow_reset) { set_property(nmc->client, connection, setting_name, @@ -5199,7 +5200,7 @@ nmc_process_connection_properties(NmCli *nmc, if (!*argc && nmc->complete) complete_option(nmc, chosen, value ?: "", connection); - if (!set_option(nmc, connection, chosen, value, error)) + if (!set_option(nmc, connection, chosen, value, TRUE, error)) return FALSE; } while (*argc); @@ -5410,7 +5411,7 @@ again: if (multi && !value) return; - if (!set_option(nmc, connection, abstract_info, value, &error)) { + if (!set_option(nmc, connection, abstract_info, value, FALSE, &error)) { g_printerr("%s\n", error->message); g_clear_error(&error); goto again; |