[openbeosnetteam] Re: DNS bug

Was our aim to have BONE compatibility? Today I surfed around with Net+ (using 
our netstack and ppp, or course ;).
Also, I could check out some sources via cvs.
Vision did not work because it wants to have BONE. The problem with BONE is 
that its SOCK_STREAM, etc values conflict with the net_stack values.
It seems that we must add our own libsocket.so and libbind.so for BONE 
compatibility. I think libbind.so could be a link to our libnet.so. 
libsocket.so would have to adjust the socket type value. I could need a helping 
hand.

I have not commited the changes to CVS because they are rather hacky (checks 
against AF_INET, etc.).
We should decide together what to do.

Bye,
Waldemar

----- Original Message ----- 
From: "Waldemar Kornewald" <Waldemar.Kornewald@xxxxxx>
To: "OpenBeOS Networking" <openbeosnetteam@xxxxxxxxxxxxx>
Sent: Wednesday, April 07, 2004 1:34 PM
Subject: [openbeosnetteam] DNS bug


Hi,
the mean DNS bug was hidden in our code. But I know where it is and now it will 
be killed! :)))
I hope this fixes it:
The bug is due to R5 compatibility mode. Our DNS code uses OBOS values (address 
family, etc.), but Net+ tries to open an R5 socket, so the boolean 
g_beos_r5_compatibility (socket.c) is set to true in socket().
If this variable is set to true connect() (socket.c) calls 
convert_from_beos_r5_sockaddr() to translate the sockaddr to our own format.
The first address gets resolved because Net+ makes the first DNS lookup before 
any other sockets were created. So, the socket code assumes we are using native 
codes. When the lookup finishes Net+ opens an R5 socket which sets 
compatibility mode. The next DNS lookup tries to use an OBOS socket, but 
connect() fails because it thinks the sockaddr is R5-style, not OBOS-style! 
Thus, all subsequent lookups fail.
I had no time to fix this, yet. Can anyone of you do this today?

Bye,
Waldemar


Other related posts: