diff options
author | Mike Karels <karels@FreeBSD.org> | 2022-11-02 15:57:59 +0000 |
---|---|---|
committer | Mike Karels <karels@FreeBSD.org> | 2022-11-02 16:03:31 +0000 |
commit | 144361386696582c04592f200a4c2e3339c81a25 (patch) | |
tree | 0bad579279aa1ec6dca8ddd0d2759e06a7d7dc92 /include | |
parent | e34adc71d3724a8b1add483310efbc63db9290a6 (diff) | |
download | src-144361386696582c04592f200a4c2e3339c81a25.tar.gz src-144361386696582c04592f200a4c2e3339c81a25.zip |
getaddrinfo: distinguish missing addrs from unresolvable names
Rework getaddrinfo(3) to return different error values for unresolvable
names (same as before, EAI_NONAME) and those without a requested addr
(EAI_ADDRFAMILY) when using DNS. This is implemented via an added
error in the nsswitch layer, NS_ADDRFAMILY, which is used only by
getaddrinfo(). The error is passed through nsdispatch(3), but that
routine has no changes to handle this error. The error originates in
the getaddrinfo DNS layer called via nsdispatch(), and is processed
by the search layer that calls nsdispatch().
While here, add a little style to returns near those that were
modified.
Reviewed in https://reviews.freebsd.org/D37139 with related changes.
Reviewed by: bz
MFC after: 1 month
Diffstat (limited to 'include')
-rw-r--r-- | include/nsswitch.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/nsswitch.h b/include/nsswitch.h index f7131292dd78..2be7a59fd1b9 100644 --- a/include/nsswitch.h +++ b/include/nsswitch.h @@ -53,6 +53,7 @@ #define NS_NOTFOUND (1<<2) /* source responded 'no such entry' */ #define NS_TRYAGAIN (1<<3) /* source busy, may respond to retry */ #define NS_RETURN (1<<4) /* stop search, e.g. for ERANGE */ +#define NS_ADDRFAMILY (1<<5) /* no addr for fam, getaddrinfo only */ #define NS_TERMINATE (NS_SUCCESS|NS_RETURN) /* flags that end search */ #define NS_STATUSMASK 0x000000ff /* bitmask to get the status flags */ |