-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MarkOffsetBits to support the qos-scripts to work together #206
base: master
Are you sure you want to change the base?
Add MarkOffsetBits to support the qos-scripts to work together #206
Conversation
@@ -775,6 +778,10 @@ config_read(const char *filename) | |||
debug(LOG_WARNING, "SSLAllowedCipherList is set but no SSL compiled in. Ignoring!"); | |||
#endif | |||
break; | |||
case oMarkOffsetBits: | |||
sscanf(p1, "%u", &config.markoffsetbits); | |||
config.markoffsetbits = config.markoffsetbits > 31 ? 0 : config.markoffsetbits; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should log if the value is too large!
* The qos-scripts using 8 bits marks (0x01 - 0xff) for their classification purpose which it has overlapped with the wifidog marks. Therefore, MarkOffsetBits should be specified in the config file for the proper offset, in this case of the qos-scripts is 8 bits and the wifidog mark then left shifted as below, 0x1 => 0x100 0x2 => 0x200 0xfe => 0xfe00 The default value of MarkOffsetBits is 0 that is no offset.
* The MarkOffsetBits should be in the range of 0 to 31, the large value should be logged with warning message. Thanks to Michael Haas (mhaas) for comment.
dc8c8bc
to
a29ba71
Compare
if (config.markoffsetbits > 31) { | ||
config.markoffsetbits = 0; | ||
debug(LOG_WARNING, "MarkOffsetBits is invalid. It should be in the range of 0 to 31. " | ||
"Fallback to no offset!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid configuration should yield a fatal error and exit.
Also needed is to update the default template configuration file provided with the new key (commented out) and the details on what is valid, use, defaults and failure mode. Finally, it needs to be rebased. |
The qos-scripts using 8 bits marks (0x01 - 0xff) for their
classification purpose which it has overlapped with the wifidog
marks.
Therefore, MarkOffsetBits should be specified in the config file
for the proper offset, in this case of the qos-scripts is 8 bits
and the wifidog mark then left shifted as below,
0x1 => 0x100
0x2 => 0x200
0xfe => 0xfe00
The default value of MarkOffsetBits is 0 that is no offset.