From fa121d8ee18978ffc25e9faeffcfa1d7c6e1592e Mon Sep 17 00:00:00 2001
From: Robert Knop <prospero@lindenlab.com>
Date: Thu, 9 Apr 2009 00:20:15 +0000
Subject: [PATCH] svn merge -r115000:116937
 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.26

Merging from server-1.26 to trunk

Only a few conflicts:

   scripts/farm_distribute : the upload rate in trunk was even more
                             conservative than the one I switched to in
                             1.26, so kept the trunk version.

   indra/llcommon/llversionserver.h : did svn revert to keep trunk

   indra/newsim/lltask.cpp : svn is weird.  The merge conflict was one
                            that it's not obvious why it was there.
                            However, Simon and I looked at it, and the
                            solution was obvious : keep the trunk blob
                            where the conflict was flagged.

   indra/lib/python : conflict was differing versions of the eventlib
                      extern.  did svn revert . to keep trunk.
---
 indra/llcommon/indra_constants.h              | 10 +++++++++
 indra/llcommon/llversionserver.h              |  2 +-
 indra/llmath/v3math.cpp                       |  1 -
 indra/llmessage/llhost.cpp                    |  2 +-
 indra/llmessage/net.cpp                       | 22 +++++++++++++++----
 indra/llmessage/net.h                         |  1 +
 indra/newview/English.lproj/InfoPlist.strings |  4 ++--
 indra/newview/Info-SecondLife.plist           |  2 +-
 indra/newview/llworldmap.h                    |  2 +-
 indra/newview/res/viewerRes.rc                |  8 +++----
 10 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h
index ae7863d100d..e6ebdfd8cf5 100644
--- a/indra/llcommon/indra_constants.h
+++ b/indra/llcommon/indra_constants.h
@@ -362,6 +362,16 @@ const U32 MAP_ITEM_CLASSIFIED = 0x08;
 const U32 MAP_ITEM_ADULT_EVENT = 0x09;
 const U32 MAP_ITEM_LAND_FOR_SALE_ADULT = 0x0a;
 
+// Region map layer numbers
+const S32 MAP_SIM_OBJECTS = 0;	
+const S32 MAP_SIM_TERRAIN = 1;
+const S32 MAP_SIM_LAND_FOR_SALE = 2;			// Transparent alpha overlay of land for sale
+const S32 MAP_SIM_IMAGE_TYPES = 3;				// Number of map layers
+const S32 MAP_SIM_INFO_MASK  		= 0x00FFFFFF;		// Agent access may be stuffed into upper byte
+const S32 MAP_SIM_LAYER_MASK 		= 0x0000FFFF;		// Layer info is in lower 16 bits
+const S32 MAP_SIM_RETURN_NULL_SIMS 	= 0x00010000;
+const S32 MAP_SIM_PRELUDE 			= 0x00020000;
+
 // Crash reporter behavior
 const char* const CRASH_SETTINGS_FILE = "settings_crash_behavior.xml";
 const char* const CRASH_BEHAVIOR_SETTING = "CrashSubmitBehavior";
diff --git a/indra/llcommon/llversionserver.h b/indra/llcommon/llversionserver.h
index f9b84dd6bda..f191f8b4f5f 100644
--- a/indra/llcommon/llversionserver.h
+++ b/indra/llcommon/llversionserver.h
@@ -36,7 +36,7 @@
 const S32 LL_VERSION_MAJOR = 1;
 const S32 LL_VERSION_MINOR = 27;
 const S32 LL_VERSION_PATCH = 0;
-const S32 LL_VERSION_BUILD = 112940;
+const S32 LL_VERSION_BUILD = 116936;
 
 const char * const LL_CHANNEL = "Second Life Server";
 
diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp
index d4031796ade..101e9d075a7 100644
--- a/indra/llmath/v3math.cpp
+++ b/indra/llmath/v3math.cpp
@@ -134,7 +134,6 @@ BOOL LLVector3::clampLength( F32 length_limit )
 			mV[0] *= length_limit;
 			mV[1] *= length_limit;
 			mV[2] *= length_limit;
-			changed = TRUE;
 		}
 	}
 
diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp
index 8e9e23393d6..238cf3e12b2 100644
--- a/indra/llmessage/llhost.cpp
+++ b/indra/llmessage/llhost.cpp
@@ -124,7 +124,7 @@ BOOL LLHost::setHostByName(const std::string& hostname)
 	he = gethostbyname(local_name.c_str());	
 	if(!he) 
 	{
-		U32 ip_address = inet_addr(hostname.c_str());
+		U32 ip_address = ip_string_to_u32(hostname.c_str());
 		he = gethostbyaddr((char *)&ip_address, sizeof(ip_address), AF_INET);
 	}
 
diff --git a/indra/llmessage/net.cpp b/indra/llmessage/net.cpp
index f63faa511ad..cc93b2bf8e7 100644
--- a/indra/llmessage/net.cpp
+++ b/indra/llmessage/net.cpp
@@ -83,6 +83,7 @@ typedef int socklen_t;
 static U32 gsnReceivingIFAddr = INVALID_HOST_IP_ADDRESS; // Address to which datagram was sent
 
 const char* LOOPBACK_ADDRESS_STRING = "127.0.0.1";
+const char* BROADCAST_ADDRESS_STRING = "255.255.255.255";
 
 #if LL_DARWIN
 	// Mac OS X returns an error when trying to set these to 400000.  Smaller values succeed.
@@ -170,7 +171,21 @@ char *u32_to_ip_string(U32 ip, char *ip_string)
 // Wrapper for inet_addr()
 U32 ip_string_to_u32(const char* ip_string)
 {
-	return inet_addr(ip_string);
+	// *NOTE: Windows doesn't support inet_aton(), so we are using
+	// inet_addr(). Unfortunately, INADDR_NONE == INADDR_BROADCAST, so 
+	// we have to check whether the input is a broadcast address before
+	// deciding that @ip_string is invalid.
+	//
+	// Also, our definition of INVALID_HOST_IP_ADDRESS doesn't allow us to
+	// use wildcard addresses. -Ambroff
+	U32 ip = inet_addr(ip_string);
+	if (ip == INADDR_NONE 
+	    && strncmp(ip_string, BROADCAST_ADDRESS_STRING, MAXADDRSTR) != 0)
+	{
+		llwarns << "ip_string_to_u32() failed, Error: Invalid IP string '" << ip_string << "'" << llendl;
+		return INVALID_HOST_IP_ADDRESS;
+	}
+	return ip;
 }
 
 
@@ -293,9 +308,8 @@ S32 start_net(S32& socket_out, int& nPort)
 	LL_DEBUGS("AppInit") << "startNet - send buffer size    : " << snd_size << LL_ENDL;
 
 	//  Setup a destination address
-	char achMCAddr[MAXADDRSTR] = " ";	/* Flawfinder: ignore */ 
 	stDstAddr.sin_family =      AF_INET;
-    stDstAddr.sin_addr.s_addr = inet_addr(achMCAddr);
+	stDstAddr.sin_addr.s_addr = INVALID_HOST_IP_ADDRESS;
     stDstAddr.sin_port =        htons(nPort);
 
 	socket_out = hSocket;
@@ -502,7 +516,7 @@ S32 start_net(S32& socket_out, int& nPort)
 	//  Setup a destination address
 	char achMCAddr[MAXADDRSTR] = "127.0.0.1";	/* Flawfinder: ignore */ 
 	stDstAddr.sin_family =      AF_INET;
-        stDstAddr.sin_addr.s_addr = inet_addr(achMCAddr);
+        stDstAddr.sin_addr.s_addr = ip_string_to_u32(achMCAddr);
         stDstAddr.sin_port =        htons(nPort);
 
 	socket_out = hSocket;
diff --git a/indra/llmessage/net.h b/indra/llmessage/net.h
index 45b07a0ab8a..f86e1f0a53d 100644
--- a/indra/llmessage/net.h
+++ b/indra/llmessage/net.h
@@ -63,6 +63,7 @@ char*		u32_to_ip_string(U32 ip, char *ip_string);	// NULL on failure, ip_string
 U32			ip_string_to_u32(const char* ip_string);	// Wrapper for inet_addr()
 
 extern const char* LOOPBACK_ADDRESS_STRING;
+extern const char* BROADCAST_ADDRESS_STRING;
 
 
 // useful MTU consts
diff --git a/indra/newview/English.lproj/InfoPlist.strings b/indra/newview/English.lproj/InfoPlist.strings
index cfd333f618e..0a1235b85d0 100644
--- a/indra/newview/English.lproj/InfoPlist.strings
+++ b/indra/newview/English.lproj/InfoPlist.strings
@@ -2,6 +2,6 @@
 
 CFBundleName = "Second Life";
 
-CFBundleShortVersionString = "Second Life version 1.23.0.0";
-CFBundleGetInfoString = "Second Life version 1.23.0.0, Copyright 2004-2008 Linden Research, Inc.";
+CFBundleShortVersionString = "Second Life version 1.24.0.0";
+CFBundleGetInfoString = "Second Life version 1.24.0.0, Copyright 2004-2008 Linden Research, Inc.";
 
diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist
index 62082fe773a..baa5ccf1b93 100644
--- a/indra/newview/Info-SecondLife.plist
+++ b/indra/newview/Info-SecondLife.plist
@@ -32,7 +32,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>1.23.0.0</string>
+	<string>1.24.0.0</string>
 	<key>CSResourcesFileMapped</key>
 	<true/>
 </dict>
diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h
index 6ce66ffab0d..bb3c97cfd9d 100644
--- a/indra/newview/llworldmap.h
+++ b/indra/newview/llworldmap.h
@@ -65,7 +65,7 @@ class LLItemInfo
 	U64			mRegionHandle;
 };
 
-#define MAP_SIM_IMAGE_TYPES 3
+// Map layers, see indra_constants.h
 // 0 - Prim
 // 1 - Terrain Only
 // 2 - Overlay: Land For Sale
diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc
index 908c4e1da3c..a902a6dff02 100644
--- a/indra/newview/res/viewerRes.rc
+++ b/indra/newview/res/viewerRes.rc
@@ -138,8 +138,8 @@ TOOLMEDIAOPEN           CURSOR                  "toolmediaopen.cur"
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,23,0,0
- PRODUCTVERSION 1,23,0,0
+ FILEVERSION 1,24,0,0
+ PRODUCTVERSION 1,24,0,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -156,12 +156,12 @@ BEGIN
         BEGIN
             VALUE "CompanyName", "Linden Lab"
             VALUE "FileDescription", "Second Life"
-            VALUE "FileVersion", "1.23.0.0"
+            VALUE "FileVersion", "1.24.0.0"
             VALUE "InternalName", "Second Life"
             VALUE "LegalCopyright", "Copyright © 2001-2008, Linden Research, Inc."
             VALUE "OriginalFilename", "SecondLife.exe"
             VALUE "ProductName", "Second Life"
-            VALUE "ProductVersion", "1.23.0.0"
+            VALUE "ProductVersion", "1.24.0.0"
         END
     END
     BLOCK "VarFileInfo"
-- 
GitLab