handle_interface(int action, const char *ifname)
{
struct interface *ifs, *ifp, *ifn, *ifl = NULL;
+ const char * const argv[] = { ifname };
int i;
if (action == -1) {
return;
}
- ifs = discover_interfaces(0, NULL);
+ ifs = discover_interfaces(-1, UNCONST(argv));
for (ifp = ifs; ifp; ifp = ifp->next) {
if (strcmp(ifp->name, ifname) != 0)
continue;
continue;
p = argv[i];
} else {
+ /* -1 means we're discovering against a specific
+ * interface, but we still need the below rules
+ * to apply. */
+ if (argc == -1 && strcmp(argv[0], ifa->ifa_name) != 0)
+ continue;
for (i = 0; i < ifdc; i++)
if (!fnmatch(ifdv[i], ifa->ifa_name, 0))
break;