summaryrefslogtreecommitdiff
path: root/main/netsock2.c
diff options
context:
space:
mode:
authorDavid Vossel <dvossel@digium.com>2010-10-18 19:16:48 +0000
committerDavid Vossel <dvossel@digium.com>2010-10-18 19:16:48 +0000
commit6a09c24baef4b980ac7309d6cade97bd1bc77c87 (patch)
treedcb66751f889246b11ce49d1c580dff4c8bb2895 /main/netsock2.c
parent30ae91cdfc1fc86f47f8256a1bf9e3d7506e8cd2 (diff)
Merged revisions 292155 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r292155 | dvossel | 2010-10-18 14:16:00 -0500 (Mon, 18 Oct 2010) | 2 lines Fixes build error for systems not supporting IPV6_TCLASS. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/netsock2.c')
-rw-r--r--main/netsock2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/main/netsock2.c b/main/netsock2.c
index d4a0f9873..80dc355ee 100644
--- a/main/netsock2.c
+++ b/main/netsock2.c
@@ -453,7 +453,7 @@ ssize_t ast_sendto(int sockfd, const void *buf, size_t len, int flags,
int ast_set_qos(int sockfd, int tos, int cos, const char *desc)
{
- int res;
+ int res = 0;
int set_tos;
int set_tclass;
struct ast_sockaddr addr;
@@ -473,6 +473,7 @@ int ast_set_qos(int sockfd, int tos, int cos, const char *desc)
}
}
+#if defined(IPV6_TCLASS) && defined(IPPROTO_IPV6)
if (set_tclass) {
if (!ast_getsockname(sockfd, &addr) && ast_sockaddr_is_ipv6(&addr)) {
if ((res = setsockopt(sockfd, IPPROTO_IPV6, IPV6_TCLASS, &tos, sizeof(tos)))) {
@@ -483,6 +484,7 @@ int ast_set_qos(int sockfd, int tos, int cos, const char *desc)
}
}
}
+#endif
#ifdef linux
if (setsockopt(sockfd, SOL_SOCKET, SO_PRIORITY, &cos, sizeof(cos))) {