Bug 22198

Summary: inet_ntop may set errno to ENOSPC and needs better docs
Product: Base System Reporter: Nick Johnson <freebsd>
Component: binAssignee: Bruce M Simpson <bms>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.1.1-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
file.diff none

Description Nick Johnson 2000-10-21 21:20:01 UTC
Instead of setting a reasonable errno, inet_ntop will set errno
to ENOSPC (No space left on device) rather than something like
EINVAL or ENOMEM when the destination char * is not large enough
to contain the resulting address.  Further, it isn't clear from
the manpage if "size" is meant to be the size of the address
or the max size of the destination array (it is meant to be the latter).

Fix: Possible fixes to inet_ntop.c and inet.3:

How-To-Repeat: 
inet_ntop(AF_INET, some_address, some_char_array, 5);
perror("inet_ntop");
Comment 1 dcs freebsd_committer freebsd_triage 2000-10-21 21:33:04 UTC
Responsible Changed
From-To: gnats-admin->freebsd-bugs

Moved from pending.
Comment 2 Bruce M Simpson freebsd_committer freebsd_triage 2004-06-14 15:18:41 UTC
State Changed
From-To: open->patched

I'll take this. Committed to HEAD with some cleanups. 


Comment 3 Bruce M Simpson freebsd_committer freebsd_triage 2004-06-14 15:18:41 UTC
Responsible Changed
From-To: freebsd-bugs->bms

I'll take this. Committed to HEAD with some cleanups.
Comment 4 Bruce M Simpson freebsd_committer freebsd_triage 2005-12-13 00:53:30 UTC
State Changed
From-To: patched->closed

-CURRENT is now -STABLE