Skip to content

Commit 8d89604

Browse files
committed
Fix #166: simplify comparison, unsigned int always > 0
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent a75dfbc commit 8d89604

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/mroute.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ static int mroute4_del_vif(struct iface *iface)
309309
rc = -1;
310310
}
311311

312-
if (iface->vif >= 0 && iface->vif < ALL_VIFS)
312+
if (iface->vif != ALL_VIFS)
313313
mroute4_prune_vif(iface->vif);
314-
iface->vif = -1;
314+
iface->vif = ALL_VIFS;
315315

316316
return rc;
317317
}
@@ -911,9 +911,9 @@ static int mroute6_del_mif(struct iface *iface)
911911
rc = -1;
912912
}
913913

914-
if (iface->mif >= 0 && iface->mif < ALL_VIFS)
914+
if (iface->mif != ALL_VIFS)
915915
mroute6_prune_mif(iface->mif);
916-
iface->mif = -1;
916+
iface->mif = ALL_VIFS;
917917

918918
return rc;
919919
}

0 commit comments

Comments
 (0)