--- gvpe/src/sockinfo.C 2003/03/28 04:05:10 1.1 +++ gvpe/src/sockinfo.C 2003/04/02 05:15:00 1.3 @@ -18,7 +18,8 @@ #include "config.h" -#include "arpa/inet.h" +#include +#include #include "gettext.h" @@ -33,10 +34,13 @@ } void -sockinfo::set (const conf_node *conf) +sockinfo::set (const conf_node *conf, u8 prot_) { + prot = prot_; host = 0; - port = htons (conf->udp_port); + port = prot_ == PROT_UDPv4 ? htons (conf->udp_port) + : prot_ == PROT_TCPv4 ? htons (conf->tcp_port) + : 0; if (conf->hostname) { @@ -48,7 +52,6 @@ //sa->sin_family = he->h_addrtype; memcpy (&host, he->h_addr_list[0], 4); - prot = PROT_UDPv4 | PROT_IPv4; } else slog (L_NOTICE, _("unable to resolve host '%s'"), conf->hostname);