summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <chingpang@gmail.com>2011-11-23 17:06:19 +0800
committerDan Williams <dcbw@redhat.com>2011-11-30 18:09:02 -0600
commit955e863e123cdf91b9f359bb56762561cb6d4d90 (patch)
treebed70733a99d8dbb5ea01ef15f37c837ac9207a5
parent17aa50f55720f092286dad10f98dd4e62aa53c5a (diff)
downloadNetworkManager-955e863e123cdf91b9f359bb56762561cb6d4d90.tar.gz
core: check the iface index correctly
If the iface name is invalid, the index is -1.
-rw-r--r--src/nm-device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nm-device.c b/src/nm-device.c
index 02c2aaf2ce..1754fe21ef 100644
--- a/src/nm-device.c
+++ b/src/nm-device.c
@@ -408,7 +408,7 @@ nm_device_set_ip_iface (NMDevice *self, const char *iface)
priv->ip_iface = g_strdup (iface);
if (priv->ip_iface) {
priv->ip_ifindex = nm_netlink_iface_to_index (priv->ip_iface);
- if (!priv->ip_ifindex) {
+ if (priv->ip_ifindex < 0) {
nm_log_warn (LOGD_HW, "(%s): failed to look up interface index", iface);
}
}