summaryrefslogtreecommitdiff
path: root/src/core/devices/nm-device-vlan.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-08-06 15:17:05 +0200
committerThomas Haller <thaller@redhat.com>2021-09-30 09:56:19 +0200
commitd64b4a30d21fa98f6a7d11c28ac21a8f9d8ee299 (patch)
treeddb782113363dea1fa8e0a38e2570c269b98ff24 /src/core/devices/nm-device-vlan.c
parentf20431bf89fd00c88659275f69419601cf98cb6b (diff)
downloadNetworkManager-next.tar.gz
core: rework IP configuration in NetworkManager using layer 3 configurationnext
Completely rework IP configuration in the daemon. Use NML3Cfg as layer 3 manager for the IP configuration of an interface. Use NML3ConfigData as pieces of configuration that the various components collect and configure. NMDevice is managing most of the IP configuration at a higher level, that is, it starts DHCP and other IP methods. Rework the state handling there. This is a huge rework of how NetworkManager daemon handles IP configuration. Some fallout is to be expected. It appears the patch deletes many lines of code. That is not accurate, because you also have to count the files `src/core/nm-l3*`, which were unused previously. Co-authored-by: Beniamino Galvani <bgalvani@redhat.com>
Diffstat (limited to 'src/core/devices/nm-device-vlan.c')
-rw-r--r--src/core/devices/nm-device-vlan.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/core/devices/nm-device-vlan.c b/src/core/devices/nm-device-vlan.c
index d1e5741170..c1902d5eea 100644
--- a/src/core/devices/nm-device-vlan.c
+++ b/src/core/devices/nm-device-vlan.c
@@ -15,7 +15,6 @@
#include "nm-device-private.h"
#include "settings/nm-settings.h"
#include "nm-act-request.h"
-#include "nm-ip4-config.h"
#include "libnm-platform/nm-platform.h"
#include "nm-device-factory.h"
#include "nm-manager.h"
@@ -85,11 +84,11 @@ parent_mtu_maybe_changed(NMDevice *parent, GParamSpec *pspec, gpointer user_data
static void
parent_hwaddr_maybe_changed(NMDevice *parent, GParamSpec *pspec, gpointer user_data)
{
- NMDevice * device = NM_DEVICE(user_data);
- NMDeviceVlan * self = NM_DEVICE_VLAN(device);
- NMConnection * connection;
- const char * new_mac, *old_mac;
- NMSettingIPConfig *s_ip6;
+ NMDevice * device = NM_DEVICE(user_data);
+ NMDeviceVlan *self = NM_DEVICE_VLAN(device);
+ NMConnection *connection;
+ const char * old_mac;
+ const char * new_mac;
/* Never touch assumed devices */
if (nm_device_sys_iface_state_is_external_or_assume(device))
@@ -113,13 +112,10 @@ parent_hwaddr_maybe_changed(NMDevice *parent, GParamSpec *pspec, gpointer user_d
NM_PRINT_FMT_QUOTE_STRING(new_mac));
if (new_mac) {
nm_device_hw_addr_set(device, new_mac, "vlan-parent", TRUE);
- nm_device_arp_announce(device);
/* When changing the hw address the interface is taken down,
* removing the IPv6 configuration; reapply it.
*/
- s_ip6 = nm_connection_get_setting_ip6_config(connection);
- if (s_ip6)
- nm_device_reactivate_ip_config(device, AF_INET6, s_ip6, s_ip6);
+ nm_device_l3cfg_commit(device, NM_L3_CFG_COMMIT_TYPE_REAPPLY, FALSE);
}
}