[Ns-bugs] [Bug 283] getsockname implementation needs support in socket base class

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Mon Sep 8 16:18:42 PDT 2008


http://www.nsnam.org/bugzilla/show_bug.cgi?id=283





------- Comment #12 from mathieu.lacage at sophia.inria.fr  2008-09-08 19:18 -------

> > At the NS3 side, GetSockName return address value by 0, when called before
> > bind(). 

The problem with your latest patch is the same as before: GetSockName must do
more than just return 0. It should also change the content of the Address
variable to contain what the linux version returns, that is, an
InetSocketAddress with the right initial values. 

i.e., for example: the right code for TcpSocketImpl:

// make sure local variables are initialized during construction
TcpSocketImpl::TcpSocketImpl ()
: m_localAddress (Ipv4Address::GetAny ()),
  m_localPort (0)
{}
int
TcpSocketImpl::GetSockName (Address &address)
{
  address = InetSocketAddress (m_localAddress, m_localPort);
  return 0;
}

Please, update your patch accordingly for UdpSocket and check that you do
something similar for PacketSocket.


-- 
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