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/+/23935 )
Change subject: socket: IPv6 support for osmo_sock_set_dscp()
......................................................................
socket: IPv6 support for osmo_sock_set_dscp()
IPv6 has the analogous to DSCP: The "traffic class" field.
See https://tools.ietf.org/html/draft-itojun-ipv6-tclass-api-03
Change-Id: Ib31b977f67d60aa7f30ca4ab6eceba3d1d5eeee1
Related: SYS#5427
---
M src/socket.c
1 file changed, 8 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/35/23935/1
diff --git a/src/socket.c b/src/socket.c
index 6afe986..a8cc5c1 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -1810,8 +1810,14 @@
/* read the original value */
rc = getsockopt(fd, IPPROTO_IP, IP_TOS, &tos, &tos_len);
- if (rc < 0)
- return rc;
+ if (rc < 0) {
+ if (errno == ENOPROTOOPT) {
+ /* this may be an IPV6 socket, let's try that. IPv6 never had the TOS
+ * legacy, so we can set the traffic class un-shifted */
+ return setsockopt(fd, IPPROTO_IPV6, IPV6_TCLASS, &dscp, sizeof(dscp));
+ } else
+ return rc;
+ }
/* mask-in the DSCP into the upper 6 bits */
tos &= 0x03;
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/23935
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ib31b977f67d60aa7f30ca4ab6eceba3d1d5eeee1
Gerrit-Change-Number: 23935
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/843ebfee/attachment.htm>