[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Linux-cluster] Multicast for GFS?

On Mon, 2004-08-09 at 13:32, Lazar Obradovic wrote:
> since it contains my mcast addr instead of real host addr. I'm debugging
> it now to see where the error happens... 

... and the reason why i had trouble is: 
debugging code revealed that he structure propperly contains node's
unicast address along with a hostname *before* bhe struct is inited by
gethostbyname2() call.

After that, both bhe and he point to new structure, which holds hostent
struct for mcast address... That's why bind() failed, so I had to use

If we all look at manual page for gethostbyname(3), we can see that this
behaviour is not strange, as noted in "NOTES": 

The functions gethostbyname() and gethostbyaddr() may return pointers to
static data, which may be overwritten by later calls. Copying the struct
hostent does not suffice, since it contains pointers - a deep copy is

I'll correct this later and send a patch :) 

Lazar Obradovic, System Engineer
laza YU net
YUnet International http://www.EUnet.yu
Dubrovacka 35/III, 11000 Belgrade
Tel: +381 11 3119901; Fax: +381 11 3119901
This e-mail is confidential and intended only for the recipient.
Unauthorized distribution, modification or disclosure of its
contents is prohibited. If you have received this e-mail in error,
please notify the sender by telephone +381 11 3119901.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]