if (sa->sa_family != AF_INET && sa->sa_family != AF_INET6)
if (sa == NULL || (sa->sa_family != AF_INET && sa->sa_family != AF_INET6))
setup_listeners(struct servent *se, struct ntpd_conf *conf, u_int *cnt){	struct listen_addr	*la;	struct ifaddrs		*ifa, *ifap;	struct sockaddr		*sa;	u_int			 new_cnt = 0;	int			 tos = IPTOS_LOWDELAY;	if (conf->listen_all) {		if (getifaddrs(&ifa) == -1)			fatal("getifaddrs");		for (ifap = ifa; ifap != NULL; ifap = ifap->ifa_next) {			sa = ifap->ifa_addr;			if (sa->sa_family != AF_INET &&			    sa->sa_family != AF_INET6)				continue;			if ((la = calloc(1, sizeof(struct listen_addr))) ==			    NULL)				fatal("setup_listeners calloc");			memcpy(&la->sa, sa, SA_LEN(sa));			TAILQ_INSERT_TAIL(&conf->listen_addrs, la, entry);		}		freeifaddrs(ifa);	}	TAILQ_FOREACH(la, &conf->listen_addrs, entry) {		new_cnt++;		switch (la->sa.ss_family) {		case AF_INET:			if (((struct sockaddr_in *)&la->sa)->sin_port == 0)				((struct sockaddr_in *)&la->sa)->sin_port =				    se->s_port;			break;		case AF_INET6:			if (((struct sockaddr_in6 *)&la->sa)->sin6_port == 0)				((struct sockaddr_in6 *)&la->sa)->sin6_port =				    se->s_port;			break;		default:			fatalx("king bula sez: af borked");		}		log_info("listening on %s",		    log_sockaddr((struct sockaddr *)&la->sa));		if ((la->fd = socket(la->sa.ss_family, SOCK_DGRAM, 0)) == -1)			fatal("socket");		if (la->sa.ss_family == AF_INET && setsockopt(la->fd,		    IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) == -1)			log_warn("setsockopt IPTOS_LOWDELAY");		if (bind(la->fd, (struct sockaddr *)&la->sa,		    SA_LEN((struct sockaddr *)&la->sa)) == -1)			fatal("bind");	}	*cnt = new_cnt;	return (0);}