This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/23968 )
Change subject: gprs_ns2: Fix yet another DSCP vs. TOS mix-up
......................................................................
gprs_ns2: Fix yet another DSCP vs. TOS mix-up
This is a follow-up to I64fee56b04d0ecd128bf661699d5071817ea96ec,
due to code duplication there was another code path that manually set
the IP_TOS socekt option that I missed in the first patch.
Related: OS#5136
Change-Id: I4bb22d0f67984077706b694eb7e75327b41b6fcf
---
M src/gb/gprs_ns2_udp.c
1 file changed, 5 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/68/23968/1
diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c
index eb7d37b..22d371f 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -514,16 +514,18 @@
struct priv_bind *priv;
int rc = 0;
+ if (dscp < 0 || dscp > 63)
+ return -EINVAL;
+
OSMO_ASSERT(gprs_ns2_is_ip_bind(bind));
priv = bind->priv;
if (dscp != priv->dscp) {
priv->dscp = dscp;
- rc = setsockopt(priv->fd.fd, IPPROTO_IP, IP_TOS,
- &dscp, sizeof(dscp));
+ rc = osmo_sock_set_dscp(priv->fd.fd, dscp);
if (rc < 0) {
- LOGBIND(bind, LOGL_ERROR, "Failed to set the DSCP to %d with ret(%d) errno(%d)\n",
+ LOGBIND(bind, LOGL_ERROR, "Failed to set the DSCP to %u with ret(%d) errno(%d)\n",
dscp, rc, errno);
}
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/23968
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4bb22d0f67984077706b694eb7e75327b41b6fcf
Gerrit-Change-Number: 23968
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210428/25ae82d6/attachment.htm>