mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-23 16:01:42 +00:00
- Move PF_LOCAL at the end of the array. PF_INET{,6} is used more often.
- Add SOCKTYPE_ANY to PF_LOCAL. - Apply AI_CANONNAME to only AF_INET{,6}. It is not meaningful for the other AFs.
This commit is contained in:
parent
6401c828ce
commit
4c60a05d25
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=288601
@ -168,12 +168,6 @@ struct explore {
|
||||
};
|
||||
|
||||
static const struct explore explore[] = {
|
||||
{ PF_LOCAL, SOCK_DGRAM, ANY,
|
||||
AF_ANY | PROTOCOL_ANY },
|
||||
{ PF_LOCAL, SOCK_STREAM, ANY,
|
||||
AF_ANY | PROTOCOL_ANY },
|
||||
{ PF_LOCAL, SOCK_SEQPACKET, ANY,
|
||||
AF_ANY | PROTOCOL_ANY },
|
||||
#ifdef INET6
|
||||
{ PF_INET6, SOCK_DGRAM, IPPROTO_UDP,
|
||||
AF_ANY | SOCKTYPE_ANY | PROTOCOL_ANY },
|
||||
@ -200,6 +194,12 @@ static const struct explore explore[] = {
|
||||
AF_ANY | SOCKTYPE_ANY },
|
||||
{ PF_INET, SOCK_RAW, ANY,
|
||||
AF_ANY | PROTOCOL_ANY },
|
||||
{ PF_LOCAL, SOCK_DGRAM, ANY,
|
||||
AF_ANY | SOCKTYPE_ANY | PROTOCOL_ANY },
|
||||
{ PF_LOCAL, SOCK_STREAM, ANY,
|
||||
AF_ANY | SOCKTYPE_ANY | PROTOCOL_ANY },
|
||||
{ PF_LOCAL, SOCK_SEQPACKET, ANY,
|
||||
AF_ANY | SOCKTYPE_ANY | PROTOCOL_ANY },
|
||||
{ -1, 0, 0, 0 },
|
||||
};
|
||||
|
||||
@ -1245,7 +1245,9 @@ explore_numeric(const struct addrinfo *pai, const char *hostname,
|
||||
if (pai->ai_family == afd->a_af) {
|
||||
GET_AI(ai, afd, p);
|
||||
GET_PORT(ai, servname);
|
||||
if ((pai->ai_flags & AI_CANONNAME)) {
|
||||
if ((pai->ai_family == AF_INET ||
|
||||
pai->ai_family == AF_INET6) &&
|
||||
(pai->ai_flags & AI_CANONNAME)) {
|
||||
/*
|
||||
* Set the numeric address itself as the canonical
|
||||
* name, based on a clarification in RFC3493.
|
||||
|
Loading…
Reference in New Issue
Block a user