From 4f80c4e00ae9f5fca432fa98c4e489555648d8fd Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Fri, 19 Jan 2018 17:32:43 +0100 Subject: [PATCH] ixfrdist: use our socket convience functions --- pdns/Makefile.am | 1 + pdns/ixfrdist.cc | 75 +++++++++++++++--------------------------------- 2 files changed, 24 insertions(+), 52 deletions(-) diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 3022fae78e..738d818736 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -601,6 +601,7 @@ ixfrdist_SOURCES = \ dnssecinfra.cc \ dnswriter.cc dnswriter.hh \ gss_context.cc gss_context.hh \ + iputils.hh iputils.cc \ ixfr.cc ixfr.hh \ ixfrdist.cc \ ixfrutils.cc ixfrutils.hh \ diff --git a/pdns/ixfrdist.cc b/pdns/ixfrdist.cc index 2089309f3c..53bc1ea1b8 100644 --- a/pdns/ixfrdist.cc +++ b/pdns/ixfrdist.cc @@ -468,17 +468,16 @@ void handleUDPRequest(int fd, boost::any&) { void handleTCPRequest(int fd, boost::any&) { ComboAddress saddr; - socklen_t socklen = sizeof(saddr); + int cfd = 0; - int cfd = accept(fd, (sockaddr*) &saddr, &socklen); - - if (cfd == -1) { - cerr<<"Accepting connection from "< allSockets; - for (const auto addr : listen_addresses) { - // Create UDP socket - int s = socket(addr.sin4.sin_family, SOCK_DGRAM, 0); - if (s < 0) { - cerr<<"[ERROR] Unable to create socket: "<(); -- 2.47.2