[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:11:55 PDT 2008


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





------- Comment #11 from mathieu.lacage at sophia.inria.fr  2008-09-08 19:11 -------
(In reply to comment #9)
> i know what has happend after reading kernel code.
> when getsockname() was called without bind(), linux kernel fill the struct
> sockaddr with the initial value(memset with zero), then it call
> move_addr_to_user() to fill the userspace sockaddr by the input namelen. 
> so,
>  if the input namelen  == 0, the output sockaddr not changed,
>  if the input namelen == sizeof(sockaddr), the output sockaddr were all zero,
>  if the input namelen (0, sizeof(sockaddr)), the output sockaddr partly zero,
> partly not changed. 

yes.

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


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