Closed naost3rn closed 1 year ago
On hand, the following patch was applied and it worked fine.
diff --git a/src/getaddrinfo_async.c b/src/getaddrinfo_async.c
index 4a56981..54317bb 100644
--- a/src/getaddrinfo_async.c
+++ b/src/getaddrinfo_async.c
@@ -166,7 +166,7 @@ getaddrinfo_async_run(struct asr_query *as, struct asr_result *ar)
#endif
if (ai->ai_flags & ~AI_MASK ||
- (ai->ai_flags & AI_CANONNAME && ai->ai_flags & AI_FQDN)) {
+ (ai->ai_flags & AI_CANONNAME && ai->ai_flags & AI_FQDN && AI_CANONNAME != AI_FQDN)) {
ar->ar_gai_errno = EAI_BADFLAGS;
async_set_state(as, ASR_STATE_HALT);
break;
Hello,
Sorry for the delay in replying.
We decided to discontinue libasr-portable and only maintain the bundled version in OpenSMTPD so this repository will be soon archived.
Does this still happens on the (updated) libasr bundled in OpenSMTPD? Does it affect OpenSMTPD too? Even if it didn't, I'd like to have this fixed in the OpenSMTPD repository as other portable projects may use that as starting point, or smtpd fall in this issue.
Can you please open a PR on the https://github.com/OpenSMTPD/OpenSMTPD repository to discuss this? Thanks!
This issue has been moved to the https://github.com/OpenSMTPD/OpenSMTPD/issues/1215.
closing since it has been moved.
Executing the following test code in Alpine Linux will result in a BADFLAGS error.
Only of the AI_CANONNAME and AI_FQDN bits can be set, Only the AI_CANONNAME and AI_FQDN bits can be set, and are verified in getaddrinfo_async_run() as follows: https://github.com/OpenSMTPD/libasr/blob/15fdb71b8b6664543189ca186810fabb579a9cf0/src/getaddrinfo_async.c#L168-L173
However, on systems such as Linux with musl that do not define AI_FQDN, it is defined as AI_CANONNAME at build time: https://github.com/OpenSMTPD/libasr/blob/15fdb71b8b6664543189ca186810fabb579a9cf0/src/asr_compat.h#L42-L44