diff options
author | Gary Ching-Pang Lin <chingpang@gmail.com> | 2011-11-23 17:06:19 +0800 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2011-11-30 18:09:02 -0600 |
commit | 955e863e123cdf91b9f359bb56762561cb6d4d90 (patch) | |
tree | bed70733a99d8dbb5ea01ef15f37c837ac9207a5 | |
parent | 17aa50f55720f092286dad10f98dd4e62aa53c5a (diff) | |
download | NetworkManager-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.c | 2 |
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); } } |