From e74c568b07b50b97873fb4ee1d776dedefbd54d6 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Fri, 1 Oct 2021 23:05:04 +0200 Subject: New upstream version 1.32.12 --- src/core/nm-iface-helper.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/core/nm-iface-helper.c') diff --git a/src/core/nm-iface-helper.c b/src/core/nm-iface-helper.c index b6e9981d..296bf091 100644 --- a/src/core/nm-iface-helper.c +++ b/src/core/nm-iface-helper.c @@ -16,19 +16,19 @@ #include #include -#include "nm-glib-aux/nm-c-list.h" +#include "libnm-glib-aux/nm-c-list.h" #include "main-utils.h" #include "NetworkManagerUtils.h" -#include "platform/nm-linux-platform.h" -#include "nm-platform/nm-platform-utils.h" +#include "libnm-platform/nm-linux-platform.h" +#include "libnm-platform/nm-platform-utils.h" #include "dhcp/nm-dhcp-manager.h" #include "ndisc/nm-ndisc.h" #include "ndisc/nm-lndp-ndisc.h" #include "nm-utils.h" -#include "nm-core-internal.h" +#include "libnm-core-intern/nm-core-internal.h" #include "nm-setting-ip6-config.h" -#include "systemd/nm-sd.h" +#include "libnm-systemd-core/nm-sd.h" #if !defined(NM_DIST_VERSION) #define NM_DIST_VERSION VERSION @@ -668,6 +668,7 @@ main(int argc, char *argv[]) global_opt.uuid, RT_TABLE_MAIN, global_opt.priority_v4, + NM_DHCP_CLIENT_FLAGS_NONE, !!global_opt.dhcp4_hostname, global_opt.dhcp4_hostname, global_opt.dhcp4_fqdn, -- cgit 1.3.0-6-gf8a5 From 88c227d90a6b7b388c5c85d72802a0ca8f05ed5c Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 13 Jan 2022 22:30:39 +0100 Subject: New upstream version 1.34.0 --- src/core/nm-iface-helper.c | 78 ++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 40 deletions(-) (limited to 'src/core/nm-iface-helper.c') diff --git a/src/core/nm-iface-helper.c b/src/core/nm-iface-helper.c index 296bf091..83ae1b54 100644 --- a/src/core/nm-iface-helper.c +++ b/src/core/nm-iface-helper.c @@ -5,7 +5,6 @@ #include "src/core/nm-default-daemon.h" -#include #include #include #include @@ -31,7 +30,7 @@ #include "libnm-systemd-core/nm-sd.h" #if !defined(NM_DIST_VERSION) - #define NM_DIST_VERSION VERSION +#define NM_DIST_VERSION VERSION #endif #define NMIH_PID_FILE_FMT NMRUNDIR "/nm-iface-helper-%d.pid" @@ -93,24 +92,29 @@ static struct { /*****************************************************************************/ static void -dhcp4_state_changed(NMDhcpClient *client, - NMDhcpState state, - NMIP4Config * ip4_config, - GHashTable * options, - gpointer user_data) +_dhcp_client_notify_cb(NMDhcpClient * client, + const NMDhcpClientNotifyData *notify_data, + gpointer user_data) { static NMIP4Config *last_config = NULL; NMIP4Config * existing; gs_unref_ptrarray GPtrArray *ip4_dev_route_blacklist = NULL; gs_free_error GError *error = NULL; + NMIP4Config * ip4_config; - g_return_if_fail(!ip4_config || NM_IS_IP4_CONFIG(ip4_config)); + if (!notify_data || notify_data->notify_type != NM_DHCP_CLIENT_NOTIFY_TYPE_STATE_CHANGED) + g_return_if_reached(); - _LOGD(LOGD_DHCP4, "new DHCPv4 client state %d", state); + nm_assert(!notify_data->state_changed.ip_config + || NM_IS_IP4_CONFIG(notify_data->state_changed.ip_config)); - switch (state) { + _LOGD(LOGD_DHCP4, "new DHCPv4 client state %d", (int) notify_data->state_changed.dhcp_state); + + switch (notify_data->state_changed.dhcp_state) { case NM_DHCP_STATE_BOUND: case NM_DHCP_STATE_EXTENDED: + ip4_config = NM_IP4_CONFIG(notify_data->state_changed.ip_config); + g_assert(ip4_config); g_assert(nm_ip4_config_get_ifindex(ip4_config) == gl.ifindex); @@ -177,41 +181,33 @@ ndisc_config_changed(NMNDisc * ndisc, } if (changed & NM_NDISC_CONFIG_ADDRESSES) { - guint8 plen; guint32 ifa_flags; /* Check, whether kernel is recent enough to help user space handling RA. * If it's not supported, we have no ipv6-privacy and must add autoconf * addresses as /128. The reason for the /128 is to prevent the kernel * from adding a prefix route for this address. */ - ifa_flags = 0; - if (nm_platform_kernel_support_get(NM_PLATFORM_KERNEL_SUPPORT_TYPE_EXTENDED_IFA_FLAGS)) { - ifa_flags |= IFA_F_NOPREFIXROUTE; - if (NM_IN_SET(global_opt.tempaddr, - NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR, - NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR)) - ifa_flags |= IFA_F_MANAGETEMPADDR; - plen = 64; - } else - plen = 128; + ifa_flags = IFA_F_NOPREFIXROUTE; + if (NM_IN_SET(global_opt.tempaddr, + NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR, + NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_PUBLIC_ADDR)) + ifa_flags |= IFA_F_MANAGETEMPADDR; nm_ip6_config_reset_addresses_ndisc(ndisc_config, rdata->addresses, rdata->addresses_n, - plen, + 64, ifa_flags); } if (NM_FLAGS_ANY(changed, NM_NDISC_CONFIG_ROUTES | NM_NDISC_CONFIG_GATEWAYS)) { - nm_ip6_config_reset_routes_ndisc( - ndisc_config, - rdata->gateways, - rdata->gateways_n, - rdata->routes, - rdata->routes_n, - RT_TABLE_MAIN, - global_opt.priority_v6, - nm_platform_kernel_support_get(NM_PLATFORM_KERNEL_SUPPORT_TYPE_RTA_PREF)); + nm_ip6_config_reset_routes_ndisc(ndisc_config, + rdata->gateways, + rdata->gateways_n, + rdata->routes, + rdata->routes_n, + RT_TABLE_MAIN, + global_opt.priority_v6); } if (changed & NM_NDISC_CONFIG_DHCP_LEVEL) { @@ -685,8 +681,8 @@ main(int argc, char *argv[]) g_error("failure to start DHCP: %s", error->message); g_signal_connect(dhcp4_client, - NM_DHCP_CLIENT_SIGNAL_STATE_CHANGED, - G_CALLBACK(dhcp4_state_changed), + NM_DHCP_CLIENT_NOTIFY, + G_CALLBACK(_dhcp_client_notify_cb), NULL); } @@ -698,7 +694,9 @@ main(int argc, char *argv[]) guint32 default_ra_timeout; int max_addresses; - nm_platform_link_set_user_ipv6ll_enabled(NM_PLATFORM_GET, gl.ifindex, TRUE); + nm_platform_link_set_inet6_addr_gen_mode(NM_PLATFORM_GET, + gl.ifindex, + NM_IN6_ADDR_GEN_MODE_NONE); if (global_opt.stable_id && (global_opt.stable_id[0] >= '0' && global_opt.stable_id[0] <= '9') @@ -710,12 +708,12 @@ main(int argc, char *argv[]) stable_id = &global_opt.stable_id[2]; } - nm_lndp_ndisc_get_sysctl(NM_PLATFORM_GET, - global_opt.ifname, - &max_addresses, - &router_solicitations, - &router_solicitation_interval, - &default_ra_timeout); + nm_ndisc_get_sysctl(NM_PLATFORM_GET, + global_opt.ifname, + &max_addresses, + &router_solicitations, + &router_solicitation_interval, + &default_ra_timeout); ndisc = nm_lndp_ndisc_new(NM_PLATFORM_GET, gl.ifindex, -- cgit 1.3.0-6-gf8a5