From nobody@FreeBSD.org  Sat Apr 19 07:06:48 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id F33BE1AD
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 19 Apr 2014 07:06:48 +0000 (UTC)
Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client did not present a certificate)
	by mx1.freebsd.org (Postfix) with ESMTPS id C66561580
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 19 Apr 2014 07:06:48 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s3J76mXE099180
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 19 Apr 2014 07:06:48 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s3J76mLO099179;
	Sat, 19 Apr 2014 07:06:48 GMT
	(envelope-from nobody)
Message-Id: <201404190706.s3J76mLO099179@cgiserv.freebsd.org>
Date: Sat, 19 Apr 2014 07:06:48 GMT
From: Michael Kerrisk <mtk.manpages@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Bug in inet3) man page (inet_aton())
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         188786
>Category:       docs
>Synopsis:       Bug in inet(3) man page (inet_aton())
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 19 07:10:00 UTC 2014
>Closed-Date:    Sat May 17 04:08:33 UTC 2014
>Last-Modified:  Wed May 21 21:30:00 UTC 2014
>Originator:     Michael Kerrisk
>Release:        10.0
>Organization:
Linux man-pages maintainer
>Environment:
n/a
>Description:
As http://www.freebsd.org/cgi/man.cgi?query=inet_aton&apropos=0&sektion=0&manpath=FreeBSD+10.0-RELEASE&arch=default&format=html, on sees the text:

     When a two	part address is	supplied, the last part	is interpreted as a
     24-bit quantity and placed	in the right most three	bytes of the network
     address.  This makes the two part address format convenient for specify-
     ing Class A network addresses as ``net.host''.

In the second line, there should I believe be the substitution: s/network$/host$/. 

I have no FreeBSD system to test, but have tested on OpenBSD and Linux.
Furthermore, the change makes sense when one reads the surrounding text.

I see the same text in the OpenBSD page, and also the NetBSD page. How
does this work -- should I submit bugs for each of those systems, or do
communicate such problems to one another?

Thanks,

Michael Kerrisk
(maintainer, Linux man-pages project)

Test code:
#define _BSD_SOURCE
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>

static void
printBytes(in_addr_t a)
{
    printf("%d", (a >> 24) & 0xff);
    printf(".");
    printf("%d", (a >> 16) & 0xff);
    printf(".");
    printf("%d", (a >> 8) & 0xff);
    printf(".");
    printf("%d", (a & 0xff));
} /* printBytes */

int
main(int argc, char *argv[])
{
    struct in_addr addr;

    if (argc != 2) {
        fprintf(stderr, "%s <dotted-address>\n", argv[0]);
        exit(EXIT_FAILURE);
    }

    if (inet_aton(argv[1], &addr) == 0) {
        fprintf(stderr, "inet_aton() failed\n");
        exit(EXIT_FAILURE);
    }

    printf("%s\n", inet_ntoa(addr));

    struct in_addr n, h;

    n.s_addr = inet_netof(addr);
    printf("Network number       : ");
    printBytes(n.s_addr);
    printf("\n");

    h.s_addr = inet_lnaof(addr);
    printf("Local network address: ");
    printBytes(h.s_addr);
    printf("\n");

    addr = inet_makeaddr(n.s_addr, h.s_addr);
    printf("Made address: %s\n", inet_ntoa(addr));

    exit(EXIT_SUCCESS);
}

>How-To-Repeat:

>Fix:
As above

>Release-Note:
>Audit-Trail:

From: Mark Linimon <linimon@lonesome.com>
To: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: docs/188786: Bug in inet(3) man page (inet_aton())
Date: Sat, 19 Apr 2014 07:54:48 -0500

 On Sat, Apr 19, 2014 at 07:06:48AM +0000, Michael Kerrisk wrote:
 > I see the same text in the OpenBSD page, and also the NetBSD page.
 > How does this work -- should I submit bugs for each of those systems,
 > or do communicate such problems to one another?
 
 Short answer: we do't automatically sync with one another.
 
 Longer answer: it would take some investigation to find out if one or
 the other of the 3 has a "canonical" set of manpages that the others
 have copied.  So, the best way is to open a PR for each.
 
 Thanks.
 
 mcl

From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Mark Linimon <linimon@lonesome.com>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: docs/188786: Bug in inet(3) man page (inet_aton())
Date: Fri, 25 Apr 2014 15:52:46 +0200

 Thanks for the info, Mark.
 
 On Sat, Apr 19, 2014 at 2:54 PM, Mark Linimon <linimon@lonesome.com> wrote:
 > On Sat, Apr 19, 2014 at 07:06:48AM +0000, Michael Kerrisk wrote:
 >> I see the same text in the OpenBSD page, and also the NetBSD page.
 >> How does this work -- should I submit bugs for each of those systems,
 >> or do communicate such problems to one another?
 >
 > Short answer: we do't automatically sync with one another.
 >
 > Longer answer: it would take some investigation to find out if one or
 > the other of the 3 has a "canonical" set of manpages that the others
 > have copied.  So, the best way is to open a PR for each.
 >
 > Thanks.
 >
 > mcl
 
 
 
 -- 
 Michael Kerrisk
 Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
 Linux/UNIX System Programming Training: http://man7.org/training/
State-Changed-From-To: open->closed 
State-Changed-By: bjk 
State-Changed-When: Sat May 17 04:06:45 UTC 2014 
State-Changed-Why:  
I do not believe this is a bug. 

The text is just referring to an IP address when it says 
"network address", and the class-A addressing scheme is just 
taking the three octets from the second component and putting 
them as the last three octets of the IPv4 address. 
In the nearby portions of this document, "network address" 
is also referring to just an IPv4 address. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=188786 

From: Mark Linimon <linimon@lonesome.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/188786: Bug in inet(3) man page (inet_aton())
Date: Wed, 21 May 2014 16:21:16 -0500

 ----- Forwarded message from "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com> -----
 
 Date: Sat, 17 May 2014 07:30:18 +0200
 From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
 To: bjk@freebsd.org
 Cc: freebsd-doc@freebsd.org
 Subject: Re: docs/188786: Bug in inet(3) man page (inet_aton())
 
 Ben,
 
 Okay -- I see what you mean--I was focused on that one piece, and
 didn't note the other uses of "network address".
 
 I think that what makes the page a little confusing is that it uses
 both terms "Internet address" and "network address" without making it
 clear that they are synonymous (and thus leaving the potential for the
 reader to think they are not). This might not normally be problematic,
 but given that the page is also talking about the 'network' and 'host'
 components of the address, there is scope for confusion. Not a big
 thing, I guess, but FWIW that's the confusion that I tried to avoid in
 the Linux man page by using the term "binary address"; see
 http://man7.org/linux/man-pages/man3/inet.3.html#DESCRIPTION
 
 Cheers,
 
 Michael
 
 ----- End forwarded message -----
>Unformatted:
