summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nm-manager.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 7914d16d1..9200b24fd 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -1614,7 +1614,12 @@ again:
static gboolean
device_is_wake_on_lan (NMPlatform *platform, NMDevice *device)
{
- return nm_platform_link_get_wake_on_lan (platform, nm_device_get_ip_ifindex (device));
+ int ifindex;
+
+ ifindex = nm_device_get_ip_ifindex (device);
+ if (ifindex <= 0)
+ return FALSE;
+ return nm_platform_link_get_wake_on_lan (platform, ifindex);
}
static void