Skip to content

Commit

Permalink
Fix DSCP tagging for dual-stack sockets on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman committed Feb 4, 2024
1 parent b7a3985 commit be6f856
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/platform/linux/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,10 @@ namespace platf {
if (dscp_tagging) {
int level;
int option;
if (address.is_v6()) {

// With dual-stack sockets, Linux uses IPV6_TCLASS for IPv6 traffic
// and IP_TOS for IPv4 traffic.
if (address.is_v6() && !address.to_v6().is_v4_mapped()) {
level = SOL_IPV6;
option = IPV6_TCLASS;
}
Expand Down

0 comments on commit be6f856

Please sign in to comment.