From: Wouter Wijngaards Date: Fri, 16 Feb 2007 23:00:31 +0000 (+0000) Subject: Small fixes, makes unbound 0.0 work on SunOS4 sparc. X-Git-Tag: release-0.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b62d2d48a7289e654dd0b734d66c1dd614fc458a;p=thirdparty%2Funbound.git Small fixes, makes unbound 0.0 work on SunOS4 sparc. git-svn-id: file:///svn/unbound/trunk@123 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/configure.ac b/configure.ac index 85c273a70..6cd19144c 100644 --- a/configure.ac +++ b/configure.ac @@ -490,11 +490,14 @@ AH_BOTTOM([ #define IPV6_MIN_MTU 1280 #endif /* IPV6_MIN_MTU */ -#ifdef AF_INET6 -#define INET6 -#else -#define AF_INET6 28 -#endif +#ifndef CHECKED_INET6 +# define CHECKED_INET6 +# ifdef AF_INET6 +# define INET6 +# else +# define AF_INET6 28 +# endif +#endif /* CHECKED_INET6 */ #ifndef HAVE_SNPRINTF #include diff --git a/doc/Changelog b/doc/Changelog index 2248faaea..97891c92b 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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, diff --git a/services/listen_dnsport.c b/services/listen_dnsport.c index 78dfc0777..2c8cf8937 100644 --- a/services/listen_dnsport.c +++ b/services/listen_dnsport.c @@ -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; diff --git a/services/outside_network.c b/services/outside_network.c index a65ab95ec..276915d1b 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -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;