vpn: fix ifindex value check

Valid interface indexes are greater than zero.
This commit is contained in:
Jiří Klimeš 2012-12-13 16:51:23 +01:00
parent 83c6ebcee7
commit 383a397a92

View file

@ -713,7 +713,7 @@ process_generic_config (NMVPNConnection *connection,
/* Grab the interface index for address/routing operations */
priv->ip_ifindex = nm_netlink_iface_to_index (priv->ip_iface);
if (priv->ip_ifindex < 0) {
if (priv->ip_ifindex <= 0) {
nm_log_err (LOGD_VPN, "(%s): failed to look up VPN interface index", priv->ip_iface);
nm_vpn_connection_config_maybe_complete (connection, FALSE);
return FALSE;