Corrected by previous assumption, since gethostbyname() has nothing to do with

struct sockaddr_in - the real culprits were BNetAddress::GetAddr(sockaddr_in&)
and BNetAddress::SetTo(const sockaddr_in&):
* moved check_r5_compatibility() into r5_compatibility.h to make that function
  available to BNetAddress, too
* adjusted sockaddr_in-handling methods of BNetAddress to deal with R5-addresses
  if in compatibility mode
* removed is_r5_sockaddr() again, since it is no longer needed

With this less hacky solution, Beam, NetPositive, NetworkTime and Vision still work. So, there's hope that the R5 compatibility layer is now complete.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26377 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2008-07-10 21:25:19 +00:00
parent bd2509c549
commit aebcc506e2
3 changed files with 49 additions and 54 deletions
+27
View File
@@ -44,4 +44,31 @@ extern addr_t __gNetworkEnd;
extern addr_t __gNetAPIStart;
extern addr_t __gNetAPIEnd;
static inline bool
check_r5_compatibility()
{
if (!__gR5Compatibility)
return false;
#ifndef __INTEL__
return false;
#else
struct stack_frame {
struct stack_frame* previous;
addr_t return_address;
};
stack_frame* frame = (stack_frame*)get_stack_frame();
if (frame->return_address >= __gNetworkStart
&& frame->return_address < __gNetworkEnd) {
return false;
}
return true;
#endif
}
#endif // NET_R5_COMPATIBILITY_H