QoS argument not applying specified value to differentiated services field in packets when IPv6 enabled - linux clients
bug
### Discussed in https://github.com/orgs/jamulussoftware/discussions/3621
<div type='discussions-op-text'>
<sup>Originally posted by **rdica** February 7, 2026</sup>
I thought I'd do some testing using the QoS argument. In reading the help output I see:
```
-Q, --qos set the QoS value. Default is 128. Disable with 0
(see the Jamulus website to enable QoS on Windows)
```
The default is applied when IPv6 is not enabled.
When specifying a value using `./jamulus -j -6 -Q 128 -i /home/jamulus/.config/Jamulus/sa.ini` the programs outputs:
```
- disable auto Jack connections
- IPv6 enabled
- selected QoS value: 128
- initialization file name: /home/jamulus/.config/Jamulus/sa.ini
- allocated port number: 22134
```
but tcpdump captures still show differentiated services field as CS0 instead of the expected CS4 that the value of 128 would set.
This only happens when enabling IPv6.
I ran the above command with
`strace -o ~/strace-qos.log -e trace=network ./jamulus -j -6 -Q 128 -i /home/jamulus/.config/Jamulus/sa.ini`
This line from strace log seems to indicate a failure with `setsockopt()` trying to apply the QoS value:
```
setsockopt(15, SOL_IPV6, IPV6_TCLASS, "\200", 1) = -1 EINVAL (Invalid argument)
```
After speaking with some IPv6 networking associates it seems the issue may lie in IPV6_TCLASS should take an 'int', not 'char'.
I've attached a pcap and strace log to help illustrate the issue.
[strace-qos.log](https://github.com/user-attachments/files/25153511/strace-qos.log)
[qos.pcap.gz](https://github.com/user-attachments/files/25153532/qos.pcap.gz)
tcpdump capture args: `tcpdump -i lo -w qos.pcap -c 1000 -v 'port 22124'`
jamulus server connect attempt to `[::1]:22124`
</div>
1 条评论