Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

neutronth
Copy link
Contributor

  • 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.

@@ -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;
Copy link
Contributor

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.
@neutronth neutronth force-pushed the devel-qos-scripts-work-together branch from dc8c8bc to a29ba71 Compare May 11, 2015 11:22
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!");
Copy link
Contributor

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.

@acv
Copy link
Contributor

acv commented Oct 1, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants