diff options
| author | 2019-01-24 15:58:57 +0000 | |
|---|---|---|
| committer | 2019-01-24 15:58:57 +0000 | |
| commit | 1799bcff97e8018156df809fd3cae3ed3d663591 (patch) | |
| tree | e8ed9f51b8d52f188c9b3d18abab4ebde915c3d4 /src/modules/m_haproxy.cpp | |
| parent | Add translation for casemapping between 2.0/3.0 (#1544) (diff) | |
| parent | Add translation for casemapping between 2.0/3.0 (#1544) (diff) | |
| download | inspircd++-1799bcff97e8018156df809fd3cae3ed3d663591.tar.gz inspircd++-1799bcff97e8018156df809fd3cae3ed3d663591.tar.bz2 inspircd++-1799bcff97e8018156df809fd3cae3ed3d663591.zip | |
Merge branch 'insp3' into master
Diffstat (limited to 'src/modules/m_haproxy.cpp')
| -rw-r--r-- | src/modules/m_haproxy.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/m_haproxy.cpp b/src/modules/m_haproxy.cpp index e92c45686..ee9079cbf 100644 --- a/src/modules/m_haproxy.cpp +++ b/src/modules/m_haproxy.cpp @@ -240,7 +240,7 @@ class HAProxyHook : public IOHookMiddle { case AF_INET: memcpy(&client.in4.sin_addr.s_addr, &recvq[0], 4); - memcpy(&server.in4.sin_addr.s_addr, &recvq[4], 8); + memcpy(&server.in4.sin_addr.s_addr, &recvq[4], 4); memcpy(&client.in4.sin_port, &recvq[8], 2); memcpy(&server.in4.sin_port, &recvq[10], 2); tlv_index = 12; @@ -256,12 +256,13 @@ class HAProxyHook : public IOHookMiddle case AF_UNIX: memcpy(client.un.sun_path, &recvq[0], 108); - memcpy(client.un.sun_path, &recvq[108], 108); + memcpy(server.un.sun_path, &recvq[108], 108); tlv_index = 216; break; } - sock->OnSetEndPoint(server, client); + if (!sock->OnSetEndPoint(server, client)) + return -1; // Parse any available TLVs. while (tlv_index < address_length) |
