… | |
… | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. |
15 | GNU General Public License for more details. |
16 | |
16 | |
17 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
18 | along with gvpe; if not, write to the Free Software |
18 | along with gvpe; if not, write to the Free Software |
19 | Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 | */ |
20 | */ |
21 | |
21 | |
22 | #include "config.h" |
22 | #include "config.h" |
23 | |
23 | |
24 | #include <netdb.h> |
24 | #include <netdb.h> |
… | |
… | |
63 | void |
63 | void |
64 | sockinfo::set (const conf_node *conf, u8 prot_) |
64 | sockinfo::set (const conf_node *conf, u8 prot_) |
65 | { |
65 | { |
66 | if (prot_ == PROT_DNSv4) |
66 | if (prot_ == PROT_DNSv4) |
67 | { |
67 | { |
68 | host = 0x01010101; port = htons (conf->id); prot = prot_; |
68 | host = htonl (conf->id); port = 0; prot = prot_; |
69 | } |
69 | } |
70 | else |
70 | else |
71 | set (conf->hostname, |
71 | set (conf->hostname, |
72 | prot_ == PROT_UDPv4 ? conf->udp_port |
72 | prot_ == PROT_UDPv4 ? conf->udp_port |
73 | : prot_ == PROT_TCPv4 ? conf->tcp_port |
73 | : prot_ == PROT_TCPv4 ? conf->tcp_port |