Small fixes, makes unbound 0.0 work on SunOS4 sparc.

git-svn-id: file:///svn/unbound/trunk@123 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2007-02-16 23:00:31 +00:00
parent bdb948f715
commit b62d2d48a7
4 changed files with 17 additions and 7 deletions

View File

@ -490,11 +490,14 @@ AH_BOTTOM([
#define IPV6_MIN_MTU 1280
#endif /* IPV6_MIN_MTU */
#ifndef CHECKED_INET6
# define CHECKED_INET6
# ifdef AF_INET6
# define INET6
# else
# define AF_INET6 28
# endif
#endif /* CHECKED_INET6 */
#ifndef HAVE_SNPRINTF
#include <stdarg.h>

View File

@ -6,6 +6,7 @@
- added util/mini-event.c and .h, a select based alternative used with
./configure --with-libevent=no
It is limited to 1024 file descriptors, and has less features.
- will not create ip6 sockets if ip6 not on the machine.
15 February 2007: Wouter
- port to FreeBSD 4.11 Dec Alpha. Also works on Solaris 10 sparc64,

View File

@ -318,6 +318,9 @@ listen_create(struct comm_base* base, int num_ifs, const char* ifs[],
if(num_ifs > 0)
hints.ai_flags |= AI_NUMERICHOST;
hints.ai_family = AF_UNSPEC;
#ifndef INET6
do_ip6 = 0;
#endif
if(!do_ip4 && !do_ip6) {
listen_delete(front);
return NULL;

View File

@ -280,6 +280,9 @@ outside_network_create(struct comm_base *base, size_t bufsize,
return NULL;
}
outnet->base = base;
#ifndef INET6
do_ip6 = 0;
#endif
calc_num46(ifs, num_ifs, do_ip4, do_ip6, num_ports,
&outnet->num_udp4, &outnet->num_udp6);
/* adds +1 to portnums so we do not allocate zero bytes. */
@ -303,8 +306,8 @@ outside_network_create(struct comm_base *base, size_t bufsize,
outnet->num_udp4 = make_udp_range(outnet->udp4_ports,
NULL, num_ports, 1, 0, port_base, outnet);
}
if(outnet->num_udp4 != num_ports ||
outnet->num_udp6 != num_ports) {
if( (do_ip4 && outnet->num_udp4 != num_ports) ||
(do_ip6 && outnet->num_udp6 != num_ports)) {
log_err("Could not open all networkside ports");
outside_network_delete(outnet);
return NULL;