]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Make VF_OPTCOMMON module mismatches a fatal link error by default
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Sep 2009 00:47:22 +0000 (00:47 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 2 Sep 2009 00:47:22 +0000 (00:47 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11620 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree/capab.cpp
src/modules/m_spanningtree/utils.cpp
src/modules/m_spanningtree/utils.h

index cd8564892026e2b03463c61f389426a64918450d..ac97674f59b69cb8024b156a00a5596bc8cc62ad 100644 (file)
@@ -192,13 +192,23 @@ bool TreeSocket::Capab(const parameterlist &params)
                        {
                                reason = "Optional Module list in CAPAB is not alphabetically ordered, cannot compare lists.";
                        }
-                       else
+                       else if (Utils->AllowOptCommon)
                        {
                                ServerInstance->SNO->WriteToSnoMask('l',
                                        "Optional module lists do not match, some commands may not work globally.%s%s%s%s",
                                        diffIneed.length() ? " Not loaded here:" : "", diffIneed.c_str(),
                                        diffUneed.length() ? " Not loaded there:" : "", diffUneed.c_str());
                        }
+                       else
+                       {
+                               reason = "Optional modules incorrectly matched on these servers, and options::allowmismatch not set.";
+                               if (diffIneed.length())
+                                       reason += " Not loaded here:" + diffIneed;
+                               if (diffUneed.length())
+                                       reason += " Not loaded there:" + diffUneed;
+                               this->SendError("CAPAB negotiation failed: "+reason);
+                               return false;
+                       }
                }
 
                if (this->CapKeys.find("PROTOCOL") == this->CapKeys.end())
index 7c17715578aed586b90218bcbb1193e8681bb83a..13a4cc760fd27e88a4a2d4118031f814f6316979 100644 (file)
@@ -510,6 +510,7 @@ void SpanningTreeUtilities::ReadConfiguration(bool rebind)
        FlatLinks = Conf->ReadFlag("security","flatlinks",0);
        HideULines = Conf->ReadFlag("security","hideulines",0);
        AnnounceTSChange = Conf->ReadFlag("options","announcets",0);
+       AllowOptCommon = Conf->ReadFlag("options", "allowmismatch", 0);
        ChallengeResponse = !Conf->ReadFlag("security", "disablehmac", 0);
        quiet_bursts = Conf->ReadFlag("performance", "quietbursts", 0);
        PingWarnTime = Conf->ReadInteger("options", "pingwarning", 0, true);
index 9936ebacf52c3576cdc7c7269e6e51b063a84506..6ac6578511e13bbc5daa5aa8403d713868e80a37 100644 (file)
@@ -83,6 +83,10 @@ class SpanningTreeUtilities : public classbase
         */
        bool AnnounceTSChange;
 
+       /** Allow modules marked as VF_OPTCOMMON to be mismatched when linking
+        */
+       bool AllowOptCommon;
+
        /** Make snomasks +CQ quiet during bursts and splits
         */
        bool quiet_bursts;