mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 03:42:06 -04:00
[master] fix build error when IP_TOS is undefined
This commit is contained in:
parent
a499dddb4b
commit
7ade93c328
1 changed files with 6 additions and 0 deletions
|
|
@ -529,6 +529,8 @@ cmsgsend(int s, int level, int type, struct addrinfo *res) {
|
|||
cmsgp = msg.msg_control;
|
||||
cmsgp->cmsg_level = level;
|
||||
cmsgp->cmsg_type = type;
|
||||
|
||||
#ifdef IP_TOS
|
||||
if (cmsgp->cmsg_type == IP_TOS) {
|
||||
cmsgp->cmsg_len = cmsg_len(sizeof(char));
|
||||
*(unsigned char*)CMSG_DATA(cmsgp) = dscp;
|
||||
|
|
@ -536,6 +538,7 @@ cmsgsend(int s, int level, int type, struct addrinfo *res) {
|
|||
cmsgp->cmsg_len = cmsg_len(sizeof(dscp));
|
||||
memcpy(CMSG_DATA(cmsgp), &dscp, sizeof(dscp));
|
||||
}
|
||||
#endif /* IP_TOS */
|
||||
|
||||
if (sendmsg(s, &msg, 0) < 0) {
|
||||
int debug = ISC_LOG_DEBUG(10);
|
||||
|
|
@ -619,8 +622,11 @@ try_dscp_v4(void) {
|
|||
freeaddrinfo(res0);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef IP_TOS
|
||||
if (setsockopt(s, IPPROTO_IP, IP_TOS, &dscp, sizeof(dscp)) == 0)
|
||||
dscp_result |= ISC_NET_DSCPSETV4;
|
||||
#endif /* IP_TOS */
|
||||
|
||||
#ifdef IP_RECVTOS
|
||||
on = 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue