From 4b6955095b4d857bccb265c22c22b2da2f382d45 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Sun, 21 May 2017 15:47:33 +0200 Subject: [PATCH] device: fix capture of device config in ipX_config_merge_and_apply() Use nm_device_get_ip_ifindex() to obtain the right ifindex for the device. Fixes the following: nm_platform_ip4_address_get_all: assertion 'ifindex > 0' failed #0 _g_log_abort () from target:/lib64/libglib-2.0.so.0 #1 g_logv () from target:/lib64/libglib-2.0.so.0 #2 g_log () from target:/lib64/libglib-2.0.so.0 #3 nm_platform_ip4_address_get_all (self=self@entry=0x1181020, ifindex=ifindex@entry=0) at src/platform/nm-platform.c:2640 #4 nm_ip4_config_capture (platform=0x1181020, ifindex=ifindex@entry=0, capture_resolv_conf=capture_resolv_conf@entry=0) at src/nm-ip4-config.c:271 #5 ip4_config_merge_and_apply (self=self@entry=0x1254a70, config=config@entry=0x0, commit=commit@entry=1) at src/devices/nm-device.c:5447 #6 activate_stage5_ip4_config_commit (self=0x1254a70) at src/devices/nm-device.c:8299 #7 activation_source_handle_cb (self=0x1254a70, family=family@entry=2) at src/devices/nm-device.c:4421 #8 activation_source_handle_cb4 (user_data=) at src/devices/nm-device.c:4358 #9 g_idle_dispatch () from target:/lib64/libglib-2.0.so.0 #10 g_main_context_dispatch () from target:/lib64/libglib-2.0.so.0 #11 g_main_context_iterate.isra () from target:/lib64/libglib-2.0.so.0 #12 g_main_loop_run () from target:/lib64/libglib-2.0.so.0 #13 main (argc=, argv=) at src/main.c:435 Fixes: a21b8882cc9defc43248afc94bf59ca0f84f0d27 (cherry picked from commit 6389d637a7e8d20e037e4bd9cea917dfc372ef17) --- src/devices/nm-device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index d28faf4c67..465734a64d 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -5492,7 +5492,7 @@ ip4_config_merge_and_apply (NMDevice *self, if (priv->queued_ip4_config_id) { g_clear_object (&priv->ext_ip4_config); priv->ext_ip4_config = nm_ip4_config_capture (nm_device_get_platform (self), - nm_device_get_ifindex (self), + nm_device_get_ip_ifindex (self), FALSE); } } @@ -6236,7 +6236,7 @@ ip6_config_merge_and_apply (NMDevice *self, g_clear_object (&priv->ext_ip6_config); g_clear_object (&priv->ext_ip6_config_captured); priv->ext_ip6_config_captured = nm_ip6_config_capture (nm_device_get_platform (self), - nm_device_get_ifindex (self), + nm_device_get_ip_ifindex (self), FALSE, NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN); if (priv->ext_ip6_config_captured)