]> git.tdb.fi Git - libs/net.git/blobdiff - source/net/sockaddr.cpp
Fix a length calculation bug in Protocol::dispatch
[libs/net.git] / source / net / sockaddr.cpp
index 9b41f81b948492dc077920dbe83ea06a80ea8a67..36e9c6882542eebc92f0e8edb3dc8e37255e8338 100644 (file)
@@ -1,7 +1,9 @@
 #include <stdexcept>
+#include "platform_api.h"
 #include "inet.h"
 #include "inet6.h"
 #include "sockaddr_private.h"
+#include "unix.h"
 
 using namespace std;
 
@@ -16,13 +18,14 @@ SockAddr *SockAddr::new_from_sys(const SysAddr &sa)
                return new InetAddr(sa);
        case AF_INET6:
                return new Inet6Addr(sa);
+       case AF_UNIX:
+               return new UnixAddr(sa);
        default:
                throw invalid_argument("SockAddr::create");
        }
 }
 
-SockAddr::SysAddr::SysAddr():
-       size(sizeof(sockaddr_storage))
+SockAddr::SysAddr::SysAddr()
 {
        addr.ss_family = AF_UNSPEC;
 }