X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_websocket.cpp;h=05a9ce2e82952e1ef2682db31a23406cb4ff2b72;hb=7cfeb971666b3a6709fe61bd01478697e6433f50;hp=5f0f9bcc83e85400e54b2ea9671f8c3e9a23e867;hpb=965460400b271a178cc415783414de43c89341bf;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_websocket.cpp b/src/modules/m_websocket.cpp index 5f0f9bcc8..05a9ce2e8 100644 --- a/src/modules/m_websocket.cpp +++ b/src/modules/m_websocket.cpp @@ -1,7 +1,9 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2016 Attila Molnar + * Copyright (C) 2019 iwalkalone + * Copyright (C) 2017-2020 Sadie Powell + * Copyright (C) 2016-2017 Attila Molnar * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -363,11 +365,15 @@ class WebSocketHook : public IOHookMiddle for (WebSocketConfig::ProxyRanges::const_iterator iter = config.proxyranges.begin(); iter != config.proxyranges.end(); ++iter) { - if (InspIRCd::MatchCIDR(*iter, luser->GetIPString(), ascii_case_insensitive_map)) + if (InspIRCd::MatchCIDR(luser->GetIPString(), *iter, ascii_case_insensitive_map)) { // Give the user their real IP address. - if (realsa == luser->client_sa) + if (realsa != luser->client_sa) luser->SetClientIP(realsa); + + // Error if changing their IP gets them banned. + if (luser->quitting) + return -1; break; } } @@ -548,7 +554,7 @@ class ModuleWebSocket : public Module Version GetVersion() CXX11_OVERRIDE { - return Version("Provides RFC 6455 WebSocket support", VF_VENDOR); + return Version("Allows WebSocket clients to connect to the IRC server.", VF_VENDOR); } };