--- gvpe/src/sockinfo.C 2005/03/01 06:27:20 1.13 +++ gvpe/src/sockinfo.C 2005/03/03 16:54:34 1.15 @@ -1,8 +1,10 @@ /* sockinfo.C -- socket address management - Copyright (C) 2003 Marc Lehmann + Copyright (C) 2003 Marc Lehmann - This program is free software; you can redistribute it and/or modify + This file is part of GVPE. + + GVPE is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -13,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software + along with gvpe; if not, write to the Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -61,13 +63,15 @@ void sockinfo::set (const conf_node *conf, u8 prot_) { - set (prot_ == PROT_DNSv4 ? ::conf.dns_forw_host - : conf->hostname, - prot_ == PROT_UDPv4 ? conf->udp_port - : prot_ == PROT_TCPv4 ? conf->tcp_port - : prot_ == PROT_DNSv4 ? conf->dns_port - : 0, - prot_); + if (prot_ == PROT_DNSv4) + set (conf->dns_hostname, conf->dns_hostname ? conf->dns_port : 0, prot_); + else + set (conf->hostname, + prot_ == PROT_UDPv4 ? conf->udp_port + : prot_ == PROT_TCPv4 ? conf->tcp_port + : prot_ == PROT_DNSv4 ? conf->dns_port + : 0, + prot_); } const sockaddr * @@ -168,6 +172,7 @@ return true; } +#if ENABLE_DNS if (conf && prot_ & PROT_DNSv4 && conf->protocols & PROT_DNSv4 @@ -176,6 +181,7 @@ set (::conf.dns_forw_host, ::conf.dns_forw_port, prot_); return true; } +#endif } return false;