core: Fix check for failure in translating link name to ifindex

rtnl_link_name2i() returns 0 (unspecified ifindex) if translation
did not succeed.
This commit is contained in:
Thomas Graf 2011-09-14 00:05:12 +02:00 committed by Dan Williams
parent d2069c56e8
commit d6864d7cf5

View file

@ -3404,7 +3404,7 @@ set_property (GObject *object, guint prop_id,
priv->iface = g_value_dup_string (value);
if (priv->iface) {
priv->ifindex = nm_netlink_iface_to_index (priv->iface);
if (priv->ifindex < 0) {
if (priv->ifindex <= 0) {
nm_log_warn (LOGD_HW, "(%s): failed to look up interface index", priv->iface);
}
}