- while ((lp = nlist_gethost(lp, argp->mon_name, 0)) != NULL) {
- if (NL_STATE(lp) != argp->state) {
+ for (lp = rtnl ; lp ; lp = lp->next)
+ if (NL_STATE(lp) != argp->state &&
+ (matchhostname(argp->mon_name, lp->dns_name) ||
+ matchhostname(ip_addr, lp->dns_name))) {