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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user