aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/mgcp/mgcp_network.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/src/mgcp/mgcp_network.c')
-rw-r--r--openbsc/src/mgcp/mgcp_network.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c
index c9edf4fed..354daadb2 100644
--- a/openbsc/src/mgcp/mgcp_network.c
+++ b/openbsc/src/mgcp/mgcp_network.c
@@ -233,6 +233,14 @@ static int create_bind(const char *source_addr, struct bsc_fd *fd, int port)
return 0;
}
+static int set_ip_tos(int fd, int tos)
+{
+ int ret;
+ ret = setsockopt(fd, IPPROTO_IP, IP_TOS,
+ &tos, sizeof(tos));
+ return ret != 0;
+}
+
static int bind_rtp(struct mgcp_endpoint *endp)
{
struct mgcp_config *cfg = endp->cfg;
@@ -249,6 +257,9 @@ static int bind_rtp(struct mgcp_endpoint *endp)
goto cleanup1;
}
+ set_ip_tos(endp->local_rtp.fd, cfg->endp_tos);
+ set_ip_tos(endp->local_rtcp.fd, cfg->endp_tos);
+
endp->local_rtp.cb = rtp_data_cb;
endp->local_rtp.data = endp;
endp->local_rtp.when = BSC_FD_READ;