if (cont && (h = host_v4(buf)) != NULL)
if (cont && (h = host_v4(buf, mask)) != NULL)
host(const char *s, int mask){	struct node_host	*h = NULL;	int			 v4mask, v6mask, cont = 1;	char			*buf = NULL, *p, *q, *ps;	if ((p = strrchr(s, '/')) != NULL) {		if (mask != -1) {			fprintf(stderr, "address with netmask specified"			    " and extra netmask supplied\n");			return (NULL);		}		mask = strtol(p+1, &q, 0);		if (!q || *q) {			fprintf(stderr, "invalid netmask\n");			return (NULL);		}		if ((buf = strdup(s)) == NULL)			err(1, "host: strdup");		if ((ps = malloc(strlen(s) - strlen(p) + 1)) == NULL)			err(1, "host: malloc");		strlcpy(ps, s, strlen(s) - strlen(p) + 1);		v4mask = v6mask = mask;	} else {		if (asprintf(&ps, "%s", s) == -1)			err(1, "host: asprintf");		if (mask == -1) {			if (asprintf(&buf, "%s", s) == -1)				err(1, "host: asprintf");			v4mask = 32;			v6mask = 128;		} else if (mask <= 128) {			if (asprintf(&buf, "%s/%d", s, mask) == -1)				err(1, "host: asprintf");			v4mask = v6mask = mask;		} else {			fprintf(stderr, "illegal mask %d\n", mask);			return (NULL);		}	}	/* interface with this name exists? */	if (cont && (h = host_if(ps, mask)) != NULL)		cont = 0;	/* IPv4 address? */	if (cont && (h = host_v4(buf)) != NULL)		cont = 0;	free(buf);	/* IPv6 address? */	if (cont && (h = host_v6(ps, v6mask)) != NULL)		cont = 0;	/* dns lookup */	if (cont && (h = host_dns(ps, v4mask, v6mask)) != NULL)		cont = 0;	free(ps);	if (h == NULL || cont == 1) {		fprintf(stderr, "no IP address found for %s\n", s);		return (NULL);	}	return (h);}