From 9e0546b1c5990d0db87cd24420f8267d5520832f Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 31 Jan 2007 01:41:33 +0000 Subject: 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 --- src/inspsocket.cpp | 7 +++---- 1 file 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) -- cgit v1.2.3