[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
On Fri, May 22, 2009 at 05:05:03PM +0000, Jukka Ruohonen wrote:
> The following reply was made to PR misc/39327; it has been noted by GNATS.
> From: Jukka Ruohonen <jruohonen%iki.fi@localhost>
> To: gnats-bugs%NetBSD.org@localhost
> Subject: Re: misc/39327
> Date: Fri, 22 May 2009 20:04:48 +0300
> 5AOn Fri, May 22, 2009 at 11:09:07AM -0400, Martin S. Weber wrote:
> > Well, it's true that it shouldn't be "the DARPA internet" anylonger, but
> > what about the other part of the fix suggestion, i.e. document in
> > /etc/procotols which domain (by socket(2) parlese) the protocol is for?
> I am not sure whether I follow you with the other part.
> 1. I think it is not so easy nor reasonable for a single operating system to
> change '/etc/protocols' because it comes from IANA, a.k.a. the Internet
> Assigned Numbers Authority. Functions like getprotobyname(3) also use
> '/etc/protocols' as a lookup; changing it will break a lot of things.
I understand that, but on the other hand even the IANA will not block
an improvement in a file they provide, will they?
> 2. Generally the file is not meant as a reference for the domain-parameter
> in socket(2), but rather as a reference for the number in the protocol-field
> of IPv4 header (or next header -field in IPv6), as described also in the
> file itsef. Even if such change would be made, there is no mapping between
> the AF_-constants and the file (surely e.g. TCP can be used both with
> AF_INET and AF_INET6).
I think there's some confusion here. I wasn't talking about the domain
parameter of socket(), but about its protocol parameter:
socket(int domain, int type, int protocol);
The domain parameter can be PF_INET, PF_INET6 and a lot of others, for
the _protocol_ parameter the manpage says, "The protocol number to use is
particular to the communication domain in which communication is to
take place; see protocols(5).".
That makes me think: There exists a mapping of domain parameters to
a set of usable protocol parameters. Look at protocols(5) (and thus
at /etc/protocols) to find out which. But /etc/protocols only documents
the possible protocols at all. Now if /etc/protocols had also a field
for the "communication domain in which communication is to take place",
there would be no doubt about usable protocols. Take "icmp 1 ICMP" for
instance. If it read "icmp 1 ICMP PF_INET" instead, it would be obvious
that icmp is not for PF_INET6. Actually even expanding the comment instead
of adding a new field to improve documentation on where this procotol
"belongs" would improve the situation in my opinion.
> 3. Moreover, I think the socket(2) manual page does not rightly give any
> impression that one should look to '/etc/protocols' for the AF_-constants.
AF_ ? The socket(2) man page only talks about PF_ constants (besides, I
personally never understood THEIR distinction but that is outside the scope
of this PR.)
Main Index |
Thread Index |