[Ns-bugs] [Bug 316] Build fails on OSX Intel
bugzilla-daemon@nsnam-www.ece.gatech.edu
bugzilla-daemon at nsnam-www.ece.gatech.edu
Sun Sep 7 10:47:59 PDT 2008
http://www.nsnam.org/bugzilla/show_bug.cgi?id=316
------- Comment #17 from mathieu.lacage at sophia.inria.fr 2008-09-07 13:47 -------
(In reply to comment #14)
> (In reply to comment #13)
> > (In reply to comment #12)
> > > By the way, the patch is not sound:
> > >
> > > - m_remotePort = ntohs(port);
> > > + m_remotePort = nsc_bytswap_16 (port);
> > >
> > > ntohs is _not_ a simple byte swap. It only swaps bytes on little endian
> > > architectures.
> >
> > no, it is safe. It is just suboptimal because it will use shifts and masks to
> > access a value when it could just read it.
>
> It's safe? I must be missing something. Clearly ntohs and nsc_bytswap_16
ok, you are right: I misread the code. However, looking at this patch
carefully, I noticed that it looks like getpeername seems to return a port
number _in network byte order_. Is this is true ? If so, this is utterly broken
!
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Ns-bugs
mailing list