From 5b78f2cac220cdfce59ea511471676d98c1095e0 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 10 Dec 2014 11:18:54 +0000 Subject: Change error number for "server didn't understand" from EBADMSG to EILSEQ, to work around fucking OpenBSD with minimal pain --- src/libs6dns/s6dns_constants_error.c | 2 +- src/libs6dns/s6dns_message_parse.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs6dns/s6dns_constants_error.c b/src/libs6dns/s6dns_constants_error.c index d5e4bcb..68a8b4d 100644 --- a/src/libs6dns/s6dns_constants_error.c +++ b/src/libs6dns/s6dns_constants_error.c @@ -7,7 +7,7 @@ static s6dns_constants_error_message_t const array[] = { { ENETUNREACH, "no available DNS server" }, - { EBADMSG, "server did not understand query" }, + { EILSEQ, "server did not understand query" }, { EBUSY, "server failure" }, { ENOENT, "no such domain" }, { ENOTSUP, "not implemented in server" }, diff --git a/src/libs6dns/s6dns_message_parse.c b/src/libs6dns/s6dns_message_parse.c index f4af437..eef9410 100644 --- a/src/libs6dns/s6dns_message_parse.c +++ b/src/libs6dns/s6dns_message_parse.c @@ -14,7 +14,7 @@ int s6dns_message_parse (s6dns_message_header_t *h, char const *packet, unsigned switch (h->rcode) { case 0 : break ; - case 1 : return (errno = EBADMSG, 0) ; + case 1 : return (errno = EILSEQ, 0) ; case 2 : return (errno = EBUSY, 0) ; case 3 : return (errno = ENOENT, 0) ; case 4 : return (errno = ENOTSUP, 0) ; -- cgit v1.2.3