Module: kamailio
Branch: master
Commit: 31deafdab78c8852fd419109fde5e2eb0898f27a
URL:
https://github.com/kamailio/kamailio/commit/31deafdab78c8852fd419109fde5e2e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-21T09:08:29+02:00
rtpengine: print warning message if setting TOS for socket fails
---
Modified: src/modules/rtpengine/rtpengine.c
---
Diff:
https://github.com/kamailio/kamailio/commit/31deafdab78c8852fd419109fde5e2e…
Patch:
https://github.com/kamailio/kamailio/commit/31deafdab78c8852fd419109fde5e2e…
---
diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c
index 5e2c1f7dc8..7ce81f7de6 100644
--- a/src/modules/rtpengine/rtpengine.c
+++ b/src/modules/rtpengine/rtpengine.c
@@ -1696,14 +1696,15 @@ static int build_rtpp_socks() {
if((0 <= control_cmd_tos) && (control_cmd_tos < 256)) {
unsigned char tos = control_cmd_tos;
if (pnode->rn_umode == 6) {
- setsockopt(rtpp_socks[pnode->idx], IPPROTO_IPV6,
+ if(setsockopt(rtpp_socks[pnode->idx], IPPROTO_IPV6,
IPV6_TCLASS, &control_cmd_tos,
- sizeof(control_cmd_tos));
+ sizeof(control_cmd_tos)))
+ LM_WARN("Failed to set IPv6 TOS socket option\n");
} else {
- setsockopt(rtpp_socks[pnode->idx], IPPROTO_IP,
- IP_TOS, &tos,
- sizeof(tos));
+ if(setsockopt(rtpp_socks[pnode->idx], IPPROTO_IP,
+ IP_TOS, &tos, sizeof(tos)))
+ LM_WARN("Failed to set IPv4 TOS socket option\n");
}
}