Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/SwiftNetwork/Protocols/Frame.swift
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ public struct Frame: ~Copyable {
}
return
}
guard newValue < 2 ^ 6 else {
guard newValue < 64 else {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? It's the same value

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting case; when running the test testIPEcho we would receive errors for DSCP values less than 50 in IPv6 cases. This line seemed to be doing bitwise XOR instead of calculating 2 to the power of 6, which is what I think was meant here. Reference on bitwise XOR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhh good call then. Thanks for fixing.

Logger.proto.fault("Cannot set DSCP value of \(newValue)")
return
}
Expand Down
Loading
Loading