]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Initialize AddressFamily for slave sockets 1349/head
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Tue, 1 Apr 2014 10:06:19 +0000 (12:06 +0200)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Tue, 1 Apr 2014 10:41:35 +0000 (12:41 +0200)
Fixes Coverity CID 727958.

pdns/sstuff.hh

index 40aa53d9c541721bf040150778207f280544df76..e77887ddceed5a77314228150dc004589f1cddbc 100644 (file)
@@ -39,8 +39,9 @@ typedef int ProtocolType; //!< Supported protocol types
 class Socket : public boost::noncopyable
 {
 private:
-  explicit Socket(int fd)
+  explicit Socket(int fd, AddressFamily af)
   {
+    d_family=af;
     d_buflen=4096;
     d_buffer=new char[d_buflen];
     d_socket=fd;
@@ -78,7 +79,7 @@ public:
       throw NetworkError("Accepting a connection: "+string(strerror(errno)));
     }
 
-    return new Socket(s);
+    return new Socket(s, d_family);
   }
 
   //! Set the socket to non-blocking
@@ -326,7 +327,7 @@ private:
   int d_socket;
   char *d_buffer;
   int d_buflen;
-  int d_family;
+  AddressFamily d_family;
 };