From 11068cf93693fdb7931c63d4d3095ab0e8c49fb3 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 3 Nov 2020 12:32:08 +0100 Subject: [PATCH] device: fix crash in nm_device_reactivate_ip_config() Fixes: 87f69f00506f ('device: merge nm_device_reactivate_ip_config() implementations for IPv4/IPv6') --- 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 63178a63c5..6e53048bb4 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -12263,10 +12263,10 @@ nm_device_reactivate_ip_config(NMDevice * self, nm_device_get_route_metric(self, AF_INET6)); } - method_old = nm_setting_ip_config_get_method(s_ip_old) + method_old = (s_ip_old ? nm_setting_ip_config_get_method(s_ip_old) : NULL) ?: (IS_IPv4 ? NM_SETTING_IP4_CONFIG_METHOD_DISABLED : NM_SETTING_IP6_CONFIG_METHOD_IGNORE); - method_new = nm_setting_ip_config_get_method(s_ip_new) + method_new = (s_ip_new ? nm_setting_ip_config_get_method(s_ip_new) : NULL) ?: (IS_IPv4 ? NM_SETTING_IP4_CONFIG_METHOD_DISABLED : NM_SETTING_IP6_CONFIG_METHOD_IGNORE);