From 893735c814c5e282598c77cc7f513ecce532c0fd Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 14 Mar 2014 15:38:51 -0500 Subject: [PATCH] platform: fix crash if link has no name after 5e935dfd When a VPN goes down, like at suspend, and the link has already disappeared, the new platform logging code tries to print the link information using a link object with only the ifindex filled in. When adding/removing/changing links, internal code often fills in just the ifindex (becuase that's all you need). Thus to_string_link() will always fail if that operation fails. at platform/nm-linux-platform.c:688 at platform/nm-linux-platform.c:1835 at vpn-manager/nm-vpn-connection.c:274 Work around that for now and live with the warnings until we decide what to actually do about to_string_link(). --- src/platform/nm-linux-platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 5f80bc36c6..6311b3b9b9 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -790,6 +790,7 @@ init_link (NMPlatform *platform, NMPlatformLink *info, struct rtnl_link *rtnllin GUdevDevice *udev_device; g_return_val_if_fail (rtnllink, FALSE); + g_return_val_if_fail (rtnl_link_get_name (rtnllink), FALSE); memset (info, 0, sizeof (*info));