pespin has uploaded this change for review.

View Change

stream: srv_link: Fix DSCP not set on already created listen socket

If DSCP is configured in an already opened srv_link, it should apply the
config on the existing socket; no need to re-create it.

Change-Id: Ib601b18c9b6a7fc944846f4ad782c43fb6a6a69a
---
M src/stream_srv.c
1 file changed, 12 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/64/43164/1
diff --git a/src/stream_srv.c b/src/stream_srv.c
index 3c8921e..901be89 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -299,7 +299,19 @@
*/
int osmo_stream_srv_link_set_ip_dscp(struct osmo_stream_srv_link *link, uint8_t ip_dscp)
{
+ int rc;
+
link->ip_dscp = ip_dscp;
+
+ if (!osmo_stream_srv_link_is_opened(link))
+ return 0;
+
+ rc = osmo_sock_set_dscp(link->ofd.fd, link->ip_dscp);
+ if (rc < 0) {
+ LOGSLNK(link, LOGL_ERROR, "set_ip_dscp(%u): failed setsockopt err=%d\n",
+ link->ip_dscp, errno);
+ return -EIO;
+ }
return 0;
}


To view, visit change 43164. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ib601b18c9b6a7fc944846f4ad782c43fb6a6a69a
Gerrit-Change-Number: 43164
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>