pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/43164?usp=email )


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

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 https://gerrit.osmocom.org/c/libosmo-netif/+/43164?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ib601b18c9b6a7fc944846f4ad782c43fb6a6a69a
Gerrit-Change-Number: 43164
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to