anchao opened a new pull request, #6970:
URL: https://github.com/apache/incubator-nuttx/pull/6970

   ## Summary
   
   net/getsockname: small addrlen should be a valid value
   
   fix usrsock getsockname fail
   
   ```
   nsh> usrsocktest
   ...
   Testing group "basic_getsockname" =>
           [TEST ASSERT FAILED!]
                   In function "basic_getsockname_open":
                   line 170: Assertion `(ssize_t)((ret)) == (ssize_t)((0))' 
failed.
                           got value: -1
                           should be: 0
           Group "basic_getsockname": [FAILED]
   ...
   ```
   
   ```
   Reference:
   
   GETSOCKNAME(2)
   
   NAME
          getsockname - get socket name
   ...
   DESCRIPTION
   ...
          The returned address is truncated if the buffer provided is too small;
          in this case, addrlen will return a value greater than was supplied 
to the call.
   ```
   
   
   ## Impact
   
   N/A
   
   ## Testing
   
   Pass the usrsock test:
   
https://github.com/apache/incubator-nuttx-apps/blob/master/examples/usrsocktest/usrsocktest_basic_getsockname.c#L168-L170


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to