Subject: misc/3133: EHOSTUNREACH undocumented in manpage for sendto(2)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <hwr@pilhuhn.de>
List: netbsd-bugs
Date: 01/22/1997 17:56:26
>Number:         3133
>Category:       misc
>Synopsis:       EHOSTUNREACH undocumented in manpage for sendto(2)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 22 09:20:01 1997
>Last-Modified:
>Originator:     Heiko W.Rupp
>Organization:
	Private site
>Release:        1.1
>Environment:
	486dx2/80, NetBSD 1.1
System: NetBSD snert.pilhuhn.de 1.1 NetBSD 1.1 (SNERT) #64: Fri Oct 4 20:43:25 GMT+0200 1996 hwr@snert.pilhuhn.de:/4pil/hwr/sys/arch/i386/compile/SNERT i386


>Description:
>From the manpage:

RETURN VALUES
     The call returns the number of characters sent, or -1 if an error oc-
     curred.
ERRORS
  .....

but sendto() can also return -1 if the remote host/net was unreachable and
errno is e.g. set to: EHOSTUNREACH


>How-To-Repeat:
	man sendto 

and

|    res=sendto(to->fd,buffer,len,NULL,   
|        (struct sockaddr *)&to->addr,sizeof(to->addr));
| 
|    if(res==-1) {
|        perror("sendto: "); 
|        return (-1);
|    }

can give the following output:

|sendto: : No route to host

>Fix:
>Audit-Trail:
>Unformatted: