diff options
Diffstat (limited to 'openbsc/src/mgcp/mgcp_network.c')
-rw-r--r-- | openbsc/src/mgcp/mgcp_network.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/openbsc/src/mgcp/mgcp_network.c b/openbsc/src/mgcp/mgcp_network.c index ceeadb168..911bb2602 100644 --- a/openbsc/src/mgcp/mgcp_network.c +++ b/openbsc/src/mgcp/mgcp_network.c @@ -231,6 +231,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; @@ -247,6 +255,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; |