Skip to content
Snippets Groups Projects
Commit fc664e93 authored by Josh Bell's avatar Josh Bell
Browse files

Port fix for SL-32157 "PowerPC Mac crashes when crossing regions or...

Port fix for SL-32157 "PowerPC Mac crashes when crossing regions or teleporting with capabilities turned on" from Branch 1-13-2 r56710 via partial merge of release-candidate -r 56743:56744
parent aeb6d0c9
No related branches found
No related tags found
No related merge requests found
...@@ -180,3 +180,26 @@ U64 ll_U64_from_sd(const LLSD& sd) ...@@ -180,3 +180,26 @@ U64 ll_U64_from_sd(const LLSD& sd)
return ((U64)high) << 32 | low; return ((U64)high) << 32 | low;
} }
// IP Address (stored in net order in a U32, so don't need swizzling)
LLSD ll_sd_from_ipaddr(const U32 val)
{
std::vector<U8> v;
v.resize(4);
memcpy(&(v[0]), &val, 4); /* Flawfinder: ignore */
return LLSD(v);
}
U32 ll_ipaddr_from_sd(const LLSD& sd)
{
U32 ret;
std::vector<U8> v = sd.asBinary();
if (v.size() < 4)
{
return 0;
}
memcpy(&ret, &(v[0]), 4); /* Flawfinder: ignore */
return ret;
}
...@@ -47,4 +47,8 @@ U32 ll_U32_from_sd(const LLSD& sd); ...@@ -47,4 +47,8 @@ U32 ll_U32_from_sd(const LLSD& sd);
LLSD ll_sd_from_U64(const U64); LLSD ll_sd_from_U64(const U64);
U64 ll_U64_from_sd(const LLSD& sd); U64 ll_U64_from_sd(const LLSD& sd);
// IP Address
LLSD ll_sd_from_ipaddr(const U32);
U32 ll_ipaddr_from_sd(const LLSD& sd);
#endif // LL_LLSDUTIL_H #endif // LL_LLSDUTIL_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment