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

[ns] ns-allinone-2.1b6: a little bug fix to run under linux



Hi,

I think I solved that problem, at least it compiles and work,
in the file:

ns-allinone-2.1b6/ns-2.1b6/indep-utils/webtrace-conv/ucb/utils.cc

at line 358:
replace:
if ((ns = accept (s,(struct sockaddr*)&from, &fromlen)) < 0)

by:

if ((ns = accept (s, (struct sockaddr*)(&from),(socklen_t *)(&fromlen)))
< 0)

depending on the system,  socklen_t varies. on a debian potato like most
linux this is how socklen is defined:

typedef unsigned int socklen_t;  (take a look at
/usr/include/bits/socket.h )
therefore, a cast is needed, and just like that,

at line  470:
replace :

if (getsockname (s, &sockname, &len) < 0)

by:

if (getsockname (s, &sockname,(socklen_t *)(&len)) < 0)



Julien Franiatte