fd = socket(src.ss_family, SOCK_DGRAM, 0);
fd = socket(res->ai_family, SOCK_DGRAM, 0);
static int udp_bind_to(sa_family_t family, unsigned int flags,                       address *local){	int err, fd, ns;	struct addrinfo hints, *res = NULL;	struct sockaddr_storage src;	int srclen;	assert(local != NULL);	assert(local->address != NULL || local->port != NULL);	assert(local->address == NULL || strlen(local->address) > 0);	assert(local->port    == NULL || strlen(local->port) > 0);		assert(flags & USE_UDP);	 	memset(&hints, 0, sizeof(hints));	hints.ai_family   = family;	hints.ai_flags    = AI_PASSIVE;	hints.ai_socktype = SOCK_DGRAM;		if (flags & NUMERIC_MODE) 		hints.ai_flags |= AI_NUMERICHOST;	err = getaddrinfo(local->address, local->port, &hints, &res);	if (err != 0) fatal("getaddrinfo error: %s", gai_strerror(err));			assert(res != NULL);	memcpy(&src, res->ai_addr, res->ai_addrlen);	srclen = res->ai_addrlen;		freeaddrinfo(res);	fd = socket(src.ss_family, SOCK_DGRAM, 0);	if (fd < 0) fatal("cannot create the socket: %s", strerror(errno));#ifdef IPV6_V6ONLY	if (family == AF_INET6) {		int on = 1;		/* in case of error, we will go on anyway... */		err = setsockopt(fd,IPPROTO_IPV6,IPV6_V6ONLY,&on,sizeof(on));		if (err < 0) perror("error with sockopt IPV6_V6ONLY");	}#endif 			if (flags & REUSE_ADDR) {		int on = 1;		/* in case of error, we will go on anyway... */		err = setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,&on,sizeof(on));		if (err < 0) perror("error with sockopt SO_REUSEADDR");	}	err = bind(fd, (struct sockaddr *)&src, srclen);	if (err != 0) fatal("cannot use specified source addr/port: %s", 		            strerror(errno));	return fd;}