Re: Re: PR 161548

2012-09-26 Thread Kevin Lo

On 2012/09/25 14:03, Matthew Seaman wrote:

On 24/09/2012 22:29, Jerry wrote:

Is there any specific reason that this PR: 161548 is still marked as
open?

o 2011/10/13 bin/161548 [patch] getent(1) inconsistent treatment of IPv6 host 
data

It simply hasn't attracted the attention of anyone with a src commit
bit. Yet.


There's no need to declare he4 and he6 as struct hostent,
the original declaration of he is fine. So here is patch.

Index: usr.bin/getent/getent.c
===
--- usr.bin/getent/getent.c (revision 240947)
+++ usr.bin/getent/getent.c (working copy)
@@ -285,6 +285,7 @@ hosts(int argc, char *argv[])
assert(argv != NULL);

sethostent(1);
+   he = NULL;
rv = RV_OK;
if (argc == 2) {
while ((he = gethostent()) != NULL)
@@ -295,8 +296,9 @@ hosts(int argc, char *argv[])
he = gethostbyaddr(addr, IN6ADDRSZ, 
AF_INET6);
else if (inet_pton(AF_INET, argv[i], (void 
*)addr)  0)
he = gethostbyaddr(addr, INADDRSZ, 
AF_INET);

-   else
-   he = gethostbyname(argv[i]);
+   else if ((he = gethostbyname2(argv[i], AF_INET6)) ==
+   NULL)
+   he = gethostbyname2(argv[i], AF_INET);
if (he != NULL)
hostsprint(he);
else {



Cheers,

Matthew



Kevin
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: PR 161548

2012-09-26 Thread Matthew Seaman
On 26/09/2012 07:27, Kevin Lo wrote:
 On 2012/09/25 14:03, Matthew Seaman wrote:
 On 24/09/2012 22:29, Jerry wrote:
 Is there any specific reason that this PR: 161548 is still marked as
 open?

 o 2011/10/13 bin/161548 [patch] getent(1) inconsistent treatment of
 IPv6 host data
 It simply hasn't attracted the attention of anyone with a src commit
 bit. Yet.
 
 There's no need to declare he4 and he6 as struct hostent,
 the original declaration of he is fine. So here is patch.
 
 Index: usr.bin/getent/getent.c
 ===
 --- usr.bin/getent/getent.c (revision 240947)
 +++ usr.bin/getent/getent.c (working copy)
 @@ -285,6 +285,7 @@ hosts(int argc, char *argv[])
 assert(argv != NULL);
 
 sethostent(1);
 +   he = NULL;
 rv = RV_OK;
 if (argc == 2) {
 while ((he = gethostent()) != NULL)
 @@ -295,8 +296,9 @@ hosts(int argc, char *argv[])
 he = gethostbyaddr(addr, IN6ADDRSZ,
 AF_INET6);
 else if (inet_pton(AF_INET, argv[i], (void
 *)addr)  0)
 he = gethostbyaddr(addr, INADDRSZ,
 AF_INET);
 -   else
 -   he = gethostbyname(argv[i]);
 +   else if ((he = gethostbyname2(argv[i],
 AF_INET6)) ==
 +   NULL)
 +   he = gethostbyname2(argv[i], AF_INET);
 if (he != NULL)
 hostsprint(he);
 else {


Not so.  Hosts frequently have both IPv6 and IPv4 addresses: your patch
would print only the IPv6 address in that case.

Cheers,

Matthew


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Re: PR 161548

2012-09-26 Thread Kevin Lo

On 2012/09/26 16:44, Matthew Seaman wrote:

On 26/09/2012 07:27, Kevin Lo wrote:

On 2012/09/25 14:03, Matthew Seaman wrote:

On 24/09/2012 22:29, Jerry wrote:

Is there any specific reason that this PR: 161548 is still marked as
open?

o 2011/10/13 bin/161548 [patch] getent(1) inconsistent treatment of
IPv6 host data

It simply hasn't attracted the attention of anyone with a src commit
bit. Yet.

There's no need to declare he4 and he6 as struct hostent,
the original declaration of he is fine. So here is patch.

Index: usr.bin/getent/getent.c
===
--- usr.bin/getent/getent.c (revision 240947)
+++ usr.bin/getent/getent.c (working copy)
@@ -285,6 +285,7 @@ hosts(int argc, char *argv[])
 assert(argv != NULL);

 sethostent(1);
+   he = NULL;
 rv = RV_OK;
 if (argc == 2) {
 while ((he = gethostent()) != NULL)
@@ -295,8 +296,9 @@ hosts(int argc, char *argv[])
 he = gethostbyaddr(addr, IN6ADDRSZ,
AF_INET6);
 else if (inet_pton(AF_INET, argv[i], (void
*)addr)  0)
 he = gethostbyaddr(addr, INADDRSZ,
AF_INET);
-   else
-   he = gethostbyname(argv[i]);
+   else if ((he = gethostbyname2(argv[i],
AF_INET6)) ==
+   NULL)
+   he = gethostbyname2(argv[i], AF_INET);
 if (he != NULL)
 hostsprint(he);
 else {


Not so.  Hosts frequently have both IPv6 and IPv4 addresses: your patch
would print only the IPv6 address in that case.


Err, right. I committed your patch, thanks.


Cheers,

Matthew





Kevin

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: PR 161548

2012-09-25 Thread Matthew Seaman
On 24/09/2012 22:29, Jerry wrote:
 Is there any specific reason that this PR: 161548 is still marked as
 open?
 
 o 2011/10/13 bin/161548 [patch] getent(1) inconsistent treatment of IPv6 host 
 data

It simply hasn't attracted the attention of anyone with a src commit
bit. Yet.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey




signature.asc
Description: OpenPGP digital signature


Re: PR 161548

2012-09-25 Thread Jerry
On Tue, 25 Sep 2012 07:03:57 +0100
Matthew Seaman articulated:

 On 24/09/2012 22:29, Jerry wrote:
  Is there any specific reason that this PR: 161548 is still marked as
  open?
  
  o 2011/10/13 bin/161548 [patch] getent(1) inconsistent treatment of
  IPv6 host data
 
 It simply hasn't attracted the attention of anyone with a src commit
 bit. Yet.

This deficiency was mentioned on the Postfix forum
http://news.gmane.org/gmane.mail.postfix.user/cutoff=232317 recently.
The PR was filed nearly a year ago. I would have thought that by now
someone would have given some thought to committing it BEFORE they
continue to pump out new versions of FreeBSD. Just my take on the
matter.

-- 
Jerry ♔

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__

Forbes Thought Of The Day

  “When a man tells you he got rich through hard work, ask him: Whose?”

— Don Marquis 


signature.asc
Description: PGP signature


PR 161548

2012-09-24 Thread Jerry
Is there any specific reason that this PR: 161548 is still marked as
open?

o 2011/10/13 bin/161548 [patch] getent(1) inconsistent treatment of IPv6 host 
data

-- 
Jerry ♔

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the Reply-To header.
__

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org