-
Notifications
You must be signed in to change notification settings - Fork 390
param: Move alias resolution before protected check #4324
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
Conversation
6ac215c
to
334ea60
Compare
bugwash: OK, waiting for @nigoroll's review. |
bin/varnishd/mgt/mgt_param.c
Outdated
|
||
orig = TRUST_ME(pp->priv); | ||
AN(orig); | ||
memcpy(alias, orig, sizeof *orig); |
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.
nitpick sizeof *alias
as a "I know my buffer overflows" style checkbox?
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.
Fair enough, I will change the sizeof
operand.
Should we have a COPY_OBJ(dest, src, magic)
macro with actual type checking?
FTR, flexelint is happy with the tree as of f26f3f7 except for Reminder: Be aware of SQUASHMEs |
f26f3f7
to
0e7e1ea
Compare
Instead of resolving tweaks when the function is called, this is now done in the MGT code performing the protected check. Since aliases may be used to reset a single bit of another parameter (namely vcc_feature) the default value is looked up before the alias resolution. Unfortunately, that also means resolving deprecated aliases before showing them to the user, adding a little bit of duplicated logic. Refs varnishcache#4323
The alternative could have been to mark both aliases and their original parameters as protected but there isn't always a one-to-one mapping between deprecated aliases and the parameters they point to. The old vcc_* boolean parameters turned into vcc_feature flags. Refs varnishcache#4323
0e7e1ea
to
d2b090b
Compare
param: Move alias resolution before protected check
Instead of resolving tweaks when the function is called, this is now
done in the MGT code performing the protected check. Since aliases may
be used to reset a single bit of another parameter (namely vcc_feature)
the default value is looked up before the alias resolution.
Unfortunately, that also means resolving deprecated aliases before
showing them to the user, adding a little bit of duplicated logic.
Refs #4323