diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-31 01:41:33 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-31 01:41:33 +0000 |
commit | 9e0546b1c5990d0db87cd24420f8267d5520832f (patch) | |
tree | 0e3d47ac8684269cbb5837051abe4924c71f3810 | |
parent | 660248d9eb56f380fbbd906827fdef0535b98894 (diff) |
ipv6 connect tweaks, to memcpy() sin6_addr's rather than assigning with =.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6469 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/inspsocket.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/inspsocket.cpp b/src/inspsocket.cpp index 678583ed0..6fd7785e4 100644 --- a/src/inspsocket.cpp +++ b/src/inspsocket.cpp @@ -153,7 +153,7 @@ bool InspSocket::BindAddr() if (insp_aton(IP.c_str(),&n) > 0) { #ifdef IPV6 - s.sin6_addr = n; + memcpy(&s.sin6_addr, &n, sizeof(n)); s.sin6_family = AF_FAMILY; #else s.sin_addr = n; @@ -192,7 +192,7 @@ bool InspSocket::DoConnect() insp_aton(this->IP,&addy); #ifdef IPV6 addr.sin6_family = AF_FAMILY; - memcpy(&addr.sin6_addr, &addy, sizeof(insp_inaddr)); + memcpy(&addr.sin6_addr, &addy, sizeof(addy)); addr.sin6_port = htons(this->port); #else addr.sin_family = AF_FAMILY; @@ -200,8 +200,7 @@ bool InspSocket::DoConnect() addr.sin_port = htons(this->port); #endif - int flags; - flags = fcntl(this->fd, F_GETFL, 0); + int flags = fcntl(this->fd, F_GETFL, 0); fcntl(this->fd, F_SETFL, flags | O_NONBLOCK); if (connect(this->fd, (sockaddr*)&this->addr,sizeof(this->addr)) == -1) |