diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-01-21 11:39:47 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-01-21 11:46:21 +0100 |
commit | 743654f3603e9209b4d7de75122bdd99ce4e97ae (patch) | |
tree | 1c155cf36a10e328161acb4d36552055112c1ae8 | |
parent | f8070f4793a748cad6deefeb1e38fe7f8a193293 (diff) |
mgcp: Honor the rtp IP_TOS settings for Osmuxon-waves/201504
Honor the IP_TOS settings for Osmux as well. Re-use the RTP
setting as it makes sense to classify the audio packets the
same way.
Fixes: OW#1369
Conflicts:
openbsc/include/openbsc/mgcp_internal.h
-rw-r--r-- | openbsc/include/openbsc/mgcp_internal.h | 2 | ||||
-rw-r--r-- | openbsc/src/libmgcp/mgcp_network.c | 6 | ||||
-rw-r--r-- | openbsc/src/libmgcp/mgcp_osmux.c | 1 | ||||
-rw-r--r-- | openbsc/src/libmgcp/mgcp_vty.c | 2 |
4 files changed, 7 insertions, 4 deletions
diff --git a/openbsc/include/openbsc/mgcp_internal.h b/openbsc/include/openbsc/mgcp_internal.h index 3bccb39df..515c1a1bd 100644 --- a/openbsc/include/openbsc/mgcp_internal.h +++ b/openbsc/include/openbsc/mgcp_internal.h @@ -243,6 +243,8 @@ void mgcp_get_net_downlink_format_default(struct mgcp_endpoint *endp, const char**subtype_name, const char**fmtp_extra); +int mgcp_set_ip_tos(int fd, int tos); + enum { MGCP_DEST_NET = 0, MGCP_DEST_BTS, diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c index 587d4e88c..4fa23da29 100644 --- a/openbsc/src/libmgcp/mgcp_network.c +++ b/openbsc/src/libmgcp/mgcp_network.c @@ -878,7 +878,7 @@ int mgcp_create_bind(const char *source_addr, struct osmo_fd *fd, int port) return 0; } -static int set_ip_tos(int fd, int tos) +int mgcp_set_ip_tos(int fd, int tos) { int ret; ret = setsockopt(fd, IPPROTO_IP, IP_TOS, @@ -902,8 +902,8 @@ static int bind_rtp(struct mgcp_config *cfg, struct mgcp_rtp_end *rtp_end, int e goto cleanup1; } - set_ip_tos(rtp_end->rtp.fd, cfg->endp_dscp); - set_ip_tos(rtp_end->rtcp.fd, cfg->endp_dscp); + mgcp_set_ip_tos(rtp_end->rtp.fd, cfg->endp_dscp); + mgcp_set_ip_tos(rtp_end->rtcp.fd, cfg->endp_dscp); rtp_end->rtp.when = BSC_FD_READ; if (osmo_fd_register(&rtp_end->rtp) != 0) { diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c index d5e671d06..7f61173a1 100644 --- a/openbsc/src/libmgcp/mgcp_osmux.c +++ b/openbsc/src/libmgcp/mgcp_osmux.c @@ -420,6 +420,7 @@ int osmux_init(int role, struct mgcp_config *cfg) LOGP(DMGCP, LOGL_ERROR, "cannot bind OSMUX socket\n"); return ret; } + mgcp_set_ip_tos(osmux_fd.fd, cfg->endp_dscp); osmux_fd.when |= BSC_FD_READ; ret = osmo_fd_register(&osmux_fd); diff --git a/openbsc/src/libmgcp/mgcp_vty.c b/openbsc/src/libmgcp/mgcp_vty.c index b29eb6b4d..a1e4431cb 100644 --- a/openbsc/src/libmgcp/mgcp_vty.c +++ b/openbsc/src/libmgcp/mgcp_vty.c @@ -376,7 +376,7 @@ DEFUN(cfg_mgcp_rtp_ip_dscp, cfg_mgcp_rtp_ip_dscp_cmd, "rtp ip-dscp <0-255>", RTP_STR - "Apply IP_TOS to the audio stream\n" "The DSCP value\n") + "Apply IP_TOS to the audio stream (including Osmux)\n" "The DSCP value\n") { int dscp = atoi(argv[0]); g_cfg->endp_dscp = dscp; |