From b8cf73a3b3e21d61f5a06670551ac22e61bcc4b1 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 28 Jan 2014 08:25:28 +1100 Subject: [PATCH] 3717. [port] hpux: Treat EOPNOTSUPP as a expected error code when probing to see if it is possible to set dscp values on a per packet basis. [RT #35252] 3716. [bug] The dns_request code was setting dcsp values when not requested. [RT #35252] --- CHANGES | 7 +++++++ lib/dns/request.c | 14 +++++++------- lib/isc/unix/net.c | 12 +++++++++--- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 697a4002a2..59d6a0bc8e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +3717. [port] hpux: Treat EOPNOTSUPP as a expected error code when + probing to see if it is possible to set dscp values + on a per packet basis. [RT #35252] + +3716. [bug] The dns_request code was setting dcsp values when not + requested. [RT #35252] + 3715. [bug] The region and city databases could fail to initialize when using some versions of libGeoIP, causing assertion failures when named was diff --git a/lib/dns/request.c b/lib/dns/request.c index 3aa98c8d3a..a11fe076a3 100644 --- a/lib/dns/request.c +++ b/lib/dns/request.c @@ -665,7 +665,7 @@ dns_request_createraw(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf, dns_request_t **requestp) { return(dns_request_createraw4(requestmgr, msgbuf, srcaddr, destaddr, - 0, options, timeout, 0, 0, task, action, + -1, options, timeout, 0, 0, task, action, arg, requestp)); } @@ -683,7 +683,7 @@ dns_request_createraw2(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf, udpretries = timeout / udptimeout; return (dns_request_createraw4(requestmgr, msgbuf, srcaddr, destaddr, - 0, options, timeout, udptimeout, + -1, options, timeout, udptimeout, udpretries, task, action, arg, requestp)); } @@ -697,7 +697,7 @@ dns_request_createraw3(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf, dns_request_t **requestp) { return (dns_request_createraw4(requestmgr, msgbuf, srcaddr, destaddr, - 0, options, timeout, udptimeout, + -1, options, timeout, udptimeout, udpretries, task, action, arg, requestp)); } @@ -868,7 +868,7 @@ dns_request_create(dns_requestmgr_t *requestmgr, dns_message_t *message, dns_request_t **requestp) { return (dns_request_createvia4(requestmgr, message, NULL, address, - 0, options, key, timeout, 0, 0, task, + -1, options, key, timeout, 0, 0, task, action, arg, requestp)); } @@ -881,7 +881,7 @@ dns_request_createvia(dns_requestmgr_t *requestmgr, dns_message_t *message, dns_request_t **requestp) { return(dns_request_createvia4(requestmgr, message, srcaddr, destaddr, - 0, options, key, timeout, 0, 0, task, + -1, options, key, timeout, 0, 0, task, action, arg, requestp)); } @@ -898,7 +898,7 @@ dns_request_createvia2(dns_requestmgr_t *requestmgr, dns_message_t *message, if (udptimeout != 0) udpretries = timeout / udptimeout; return (dns_request_createvia4(requestmgr, message, srcaddr, destaddr, - 0, options, key, timeout, udptimeout, + -1, options, key, timeout, udptimeout, udpretries, task, action, arg, requestp)); } @@ -913,7 +913,7 @@ dns_request_createvia3(dns_requestmgr_t *requestmgr, dns_message_t *message, dns_request_t **requestp) { return (dns_request_createvia4(requestmgr, message, srcaddr, destaddr, - 0, options, key, timeout, udptimeout, + -1, options, key, timeout, udptimeout, udpretries, task, action, arg, requestp)); } diff --git a/lib/isc/unix/net.c b/lib/isc/unix/net.c index e632302092..0f440981e5 100644 --- a/lib/isc/unix/net.c +++ b/lib/isc/unix/net.c @@ -497,8 +497,8 @@ cmsgsend(int s, int level, int type, struct addrinfo *res) { } control; struct cmsghdr *cmsgp; int dscp = 46; - struct iovec iovec = { (void *)&iovec, sizeof(iovec) }; - char buf[sizeof(iovec)]; + struct iovec iovec; + char buf[1] = { 0 }; isc_result_t result; if (bind(s, res->ai_addr, res->ai_addrlen) < 0) { @@ -517,6 +517,9 @@ cmsgsend(int s, int level, int type, struct addrinfo *res) { return (ISC_FALSE); } + iovec.iov_base = buf; + iovec.iov_len = sizeof(buf); + memset(&msg, 0, sizeof(msg)); msg.msg_name = (struct sockaddr *)&ss; msg.msg_namelen = len; @@ -552,6 +555,9 @@ cmsgsend(int s, int level, int type, struct addrinfo *res) { switch (errno) { #ifdef ENOPROTOOPT case ENOPROTOOPT: +#endif +#ifdef EOPNOTSUPP + case EOPNOTSUPP: #endif case EINVAL: break; @@ -582,7 +588,7 @@ cmsgsend(int s, int level, int type, struct addrinfo *res) { RUNTIME_CHECK(result == ISC_R_SUCCESS); iovec.iov_base = buf; - iovec.iov_len = sizeof(len); + iovec.iov_len = sizeof(buf); memset(&msg, 0, sizeof(msg)); msg.msg_name = (struct sockaddr *)&ss;