Re: docs/189268: 3 getaddrinfo(3) - hostanme="localhost", but it returns IN_ADDR_ANY (0.0.0.0)

2014-05-03 Thread Dreamcat4
The following reply was made to PR docs/189268; it has been noted by GNATS.

From: Dreamcat4 
To: bug-follo...@freebsd.org, dreamc...@gmail.com
Cc:  
Subject: Re: docs/189268: 3 getaddrinfo(3) - hostanme="localhost",
 but it returns IN_ADDR_ANY (0.0.0.0)
Date: Sat, 3 May 2014 08:29:44 +0100

 --089e012953d0181fd904f879df3a
 Content-Type: text/plain; charset=UTF-8
 
 Ah,
 I have researched a little more. It is my impression that the expected
 result aught to be "::1" if the protocol family was PF_UNSPEC or PF_INET6.
 
 Now that Allan has mentioned it. Commenting out the ::1 in /etc/hosts does
 change the result. However that isn't something the gSOAP library which is
 making that API call has any control over.
 
 Also:
 
 This bug occurs when the protocol family being requested is set to
 "PF_UNSPEC" (unspecified). OR "PF_INET6". With the default "/etc/hosts"
 file (where that ::1 localhost entry exists).
 
 Wheras setting:
 
 hints.ai_family   = PF_INET;
 
 returns 127.0.0.1 regardless of the ::1 in /etc/hosts file.
 
 Setting:
 
 hints.ai_family   = PF_INET6;
 
 also gives such incorrect "0.0.0.0", except if commenting out ::1 in
 /etc/hosts as Alan says.
 
 Then it gives:
 
 getaddrinfo ~/ root~# gcc test.c -o test && ./test
 getaddrinfo failed with code 8.
 
 Which would be correct to error out since no corresponding ip6 address
 found.
 
 
 The gSOAP library seems to choose PF_UNSPEC because they want to support
 both ipv4 and ipv6 protocols simultaneously (as many others also do). I'm
 not sure if they could fix downstream the issue by avoiding PF_UNSPEC
 because the bug will still occur on PF_INET6.
 
 
 Anyway. Heres is the gSOAP code where getaddrinfo() is being called in
 "soap_bind()":
 
 http://sourceforge.net/p/gsoap2/code/HEAD/tree/gsoap/stdsoap2.cpp#l4789
 
 http://sourceforge.net/p/gsoap2/code/HEAD/tree/gsoap/stdsoap2.cpp#l4791
 
 Then later on in soap_bind() the incorrect address (0.0.0.0), is used are
 the parameter being passed into bind()
 
 http://sourceforge.net/p/gsoap2/code/HEAD/tree/gsoap/stdsoap2.cpp#l4876
 
 --089e012953d0181fd904f879df3a
 Content-Type: text/html; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable
 
 Ah,I have researched a little more. I=
 t is my impression that the expected result aught to be "::1" if =
 the protocol family was PF_UNSPEC or PF_INET6.
 
 Now that Allan has mentioned it. Commenting out the ::1 in /etc/hosts does =
 change the result. However that isn't something the gSOAP library which=
  is making that API call has any control over.Also:
 
 This bug occurs when the protocol family being requeste=
 d is set to "PF_UNSPEC" (unspecified). OR "PF_INET6". W=
 ith the default "/etc/hosts" file (where that ::1 localhost entry=
  exists).
 
 Wheras setting:hints.ai_famil=
 y =C2=A0 =3D PF_INET;returns 127.0.0.1 regardless=
  of the ::1 in /etc/hosts file.Setting:=
 
 
 hints.ai_family =C2=A0 =3D PF_INET6;also gives such incorrect "0.0.0.0", except if comme=
 nting out ::1 in /etc/hosts as Alan says.Then it =
 gives:
 
 getaddrinfo ~/ root~# gcc test.c -o test &&=
 ; ./testgetaddrinfo failed with code 8.Which would be correct to error out since no corresponding ip6 addre=
 ss found.
 
 The gSOAP library seems to choose PF_UNS=
 PEC because they want to support both ipv4 and ipv6 protocols simultaneousl=
 y (as many others also do). I'm not sure if they could fix downstream t=
 he issue by avoiding PF_UNSPEC because the bug will still occur on PF_INET6=
 .
 
 Anyway. Heres is the gSOAP code wh=
 ere getaddrinfo() is being called in "soap_bind()":http://sourceforge.net/p/gsoap2/code/HEAD/tree/gsoap=
 /stdsoap2.cpp#l4789">http://sourceforge.net/p/gsoap2/code/HEAD/tree/gsoap/s=
 tdsoap2.cpp#l4789
 
 http://sourceforge.net/p/gsoap2/code/H=
 EAD/tree/gsoap/stdsoap2.cpp#l4791">http://sourceforge.net/p/gsoap2/code/HEA=
 D/tree/gsoap/stdsoap2.cpp#l4791Then later=
  on in soap_bind() the incorrect address (0.0.0.0), is used are the paramet=
 er being passed into bind()
 
 http://sourceforge.net/p/gsoap2/code/HE=
 AD/tree/gsoap/stdsoap2.cpp#l4876">http://sourceforge.net/p/gsoap2/code/HEAD=
 /tree/gsoap/stdsoap2.cpp#l4876
 
 
 
 --089e012953d0181fd904f879df3a--
___
freebsd-doc@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-doc
To unsubscribe, send any mail to "freebsd-doc-unsubscr...@freebsd.org"


Re: docs/189268: 3 getaddrinfo(3) - hostanme="localhost", but it returns IN_ADDR_ANY (0.0.0.0)

2014-05-03 Thread Dreamcat4
The following reply was made to PR docs/189268; it has been noted by GNATS.

From: Dreamcat4 
To: bug-follo...@freebsd.org, dreamc...@gmail.com
Cc:  
Subject: Re: docs/189268: 3 getaddrinfo(3) - hostanme="localhost",
 but it returns IN_ADDR_ANY (0.0.0.0)
Date: Sat, 3 May 2014 08:44:57 +0100

 --001a1133059e7da3f704f87a150e
 Content-Type: text/plain; charset=UTF-8
 
 getaddrinfo() returns a list of results. So I have updated my test program
 to walk the entire list. It now prints two results for PF_UNSPEC
 
 getaddrinfo ~/ root~# gcc test.c -o test && ./test
 0.0.0.0
 127.0.0.1
 getaddrinfo ~/ root~#
 
 Where the first result in the list is supposed to be the ipv6's "::1" (but
 isn't).
 
 Anyway heres the new version of the test.c
 
 getaddrinfo ~/ root~# cat test.c
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
 
 /* man getaddrinfo */
 
 int main()
 {
   struct addrinfo *addrinfo = NULL;
   struct addrinfo *rp = NULL;
   struct addrinfo hints;
   struct addrinfo res;
   int err;
 
   memset((void*)&hints, 0, sizeof(hints));
   hints.ai_family   = PF_UNSPEC;
   hints.ai_socktype = SOCK_STREAM;
   hints.ai_flags= AI_PASSIVE;
 
   err = getaddrinfo("localhost", "18083", &hints, &addrinfo);
 
   if (addrinfo)
   {
 for (rp = addrinfo; rp != NULL; rp = rp->ai_next)
 {
   printf("%s\n", inet_ntoa( ((struct
 sockaddr_in*)rp->ai_addr)->sin_addr ));
 }
 
 freeaddrinfo(addrinfo);
 return(0);
   }
 
   if (err || !addrinfo)
   {
 printf("getaddrinfo failed with code %i.\n",err);
 return(1);
   }
 
   printf("end_main()\n");
   return (0);
 
 }
 
 getaddrinfo ~/ root~# gcc test.c -o test && ./test
 0.0.0.0
 127.0.0.1
 getaddrinfo ~/ root~#
 
 --001a1133059e7da3f704f87a150e
 Content-Type: text/html; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable
 
 getaddrinfo() returns a list of results. So I have updated=
  my test program to walk the entire list. It now prints two results for PF_=
 UNSPECgetaddrinfo ~/ root~# gcc test.c -o tes=
 t && ./test
 
 0.0.0.0127.0.0.1getaddrinfo ~/ root~#=C2=A0Where the first result in the list is supp=
 osed to be the ipv6's "::1" (but isn't).
 
 Anyway heres the new version of the test.cgetaddrinfo ~/ root~# cat test.c=C2=A0#include #include 
 
 #include #include #include #include #include 
 
 /* man getaddrinfo */int main(){<=
 /div>=C2=A0 struct addrinfo *addrinfo =3D NULL;=C2=A0 struc=
 t addrinfo *rp =3D NULL;=C2=A0 struct addrinfo hints;=
 =C2=A0 struct addrinfo res;
 
 =C2=A0 int err;=C2=A0 memset((void*)&hin=
 ts, 0, sizeof(hints));=C2=A0 hints.ai_family =C2=A0 =3D PF_UNSPE=
 C;=C2=A0 hints.ai_socktype =3D SOCK_STREAM;=C2=A0 hin=
 ts.ai_flags =C2=A0 =C2=A0=3D AI_PASSIVE;
 
 =C2=A0 err =3D getaddrinfo("localhost", "=
 ;18083", &hints, &addrinfo);=C2=A0 i=
 f (addrinfo)=C2=A0 {=C2=A0=C2=A0 =C2=A0 for (rp =3D a=
 ddrinfo; rp !=3D NULL; rp =3D rp->ai_next)
 
 =C2=A0 =C2=A0 {=C2=A0 =C2=A0 =C2=A0 printf("%s\n"=
 , inet_ntoa( ((struct sockaddr_in*)rp->ai_addr)->sin_addr ));=C2=A0 =C2=A0 }=C2=A0 =C2=A0 freeaddrinfo(addr=
 info);=C2=A0 =C2=A0 return(0);
 
 =C2=A0 }=C2=A0 if (err || !addrinfo)=
 =C2=A0 {=C2=A0 =C2=A0 printf("getaddrinfo failed with code =
 %i.\n",err);=C2=A0 =C2=A0 return(1);=C2=A0 }=C2=A0 printf("end_main()\n");
 
 =C2=A0 return (0);}getaddrinfo ~/ root~# gcc test.c -o test && ./test0.0.0=
 .0127.0.0.1getaddrinfo ~/ root~#=C2=A0
 
 
 
 --001a1133059e7da3f704f87a150e--
___
freebsd-doc@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-doc
To unsubscribe, send any mail to "freebsd-doc-unsubscr...@freebsd.org"


Re: docs/181576: make.1: make is bmake but man make documents pmake

2014-05-03 Thread linimon
Old Synopsis: make is bmake but man make documents pmake
New Synopsis: make.1: make is bmake but man make documents pmake

Responsible-Changed-From-To: freebsd-bugs->freebsd-doc
Responsible-Changed-By: linimon
Responsible-Changed-When: Sun May 4 05:30:24 UTC 2014
Responsible-Changed-Why: 
documentation bug.

http://www.freebsd.org/cgi/query-pr.cgi?pr=181576
___
freebsd-doc@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-doc
To unsubscribe, send any mail to "freebsd-doc-unsubscr...@freebsd.org"