PF_xxx or AF_xxx? comment of dom_family in sys/uipc_domain.h
Masato Asou
asou at soum.co.jp
Thu Sep 12 04:48:03 UTC 2013
Hi,
I have a little question.
In manual SOCKET(2) describes as follows.
The domain argument specifies a communications domain within which commu-
nication will take place; this selects the protocol family which should
be used. These families are defined in the include file <sys/socket.h>.
The currently understood formats are:
PF_LOCAL Host-internal protocols, formerly called PF_UNIX,
PF_UNIX Host-internal protocols, deprecated, use PF_LOCAL,
PF_INET Internet version 4 protocols,
However, comment of dom_fammily in /usr/src/sys/sys/uipc_domain.h as
follows.
struct domain {
int dom_family; /* AF_xxx */
The dom_fammily was used in function /usr/src/sys/kern/uipc_domain.c:
pffindtype() as follows.
struct protosw *
pffindtype(int family, int type)
{
struct domain *dp;
struct protosw *pr;
for (dp = domains; dp; dp = dp->dom_next)
if (dp->dom_family == family)
goto found;
The argument domain of SOCKET(2) passed to the argument family of
function pffindtype(). If SOCKET(2) is correct, described as
/* PF_xxx */ instead /* AF_xxx */ in sys/uipc_domain.h?
I know PF_xxx is equals AF_xxx defined in sys/socket.h.
I don't believe this is serious mistake.
Regards,
--
ASOU Masato
More information about the freebsd-questions
mailing list