-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
network: several cleanups and fix IPv4DAD and IP Masqurade #17240
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
3518bd8 to
4170786
Compare
2af5f84 to
ba4677f
Compare
keszybz
left a comment
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.
Looks very nice.
I made a few comments that follow the overall pattern of renaming foo_verify_bar to foo_drop_invalid_bar. This is a suggestion, and if you think _verify_ is OK, I'm fine with that. If you decide to rename them, I think it'd be better to do it in a single commit at the end, to avoid nasty rebasing and patch failures.
| }) | ||
|
|
||
| #define netlink_add_match(nl, ret_slot, metch, callback, destroy_callback, userdata) \ | ||
| #define netlink_add_match(nl, ret_slot, match, callback, destroy_callback, userdata, description) \ |
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.
Hmm, but match was referenced below? Did we happen to always have a match variable in the scope?
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.
I was introduced the macro in the past, but it is never used. So, I did not notice the typo...
| address->section->filename, address->section->line); | ||
|
|
||
| address->scope = RT_SCOPE_HOST; | ||
| } |
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.
if (in_addr_is_localhost(address->family, &address->in_addr) > 0) {
if (address->family == AF_INET && address->scope_set && address->scope != RT_SCOPE_HOST)
log_warning_errno(SYNTHETIC_ERRNO(EINVAL),
"%s: non-host scope is set in the [Address] section from line %u. "
"Ignoring Scope= setting.",
address->section->filename, address->section->line);
address->scope = RT_SCOPE_HOST;
address->scope_set = true;
}?
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.
My change is intended the following:
For IPv4, scope should be always RT_SCOPE_HOST.
For IPv6, use RT_SCOPE_HOST when scope is not explicitly specified.
I keep the code, and added the above comments in the code.
And reduce scope of variables.
[RoutingPolicyRule] sections are managed by both LIST and Hashmap. Let's drop list.
Previously, IPv4 DAD is configured in each Address object stored in Network object. If a .network file matches multipe links, then it causes an assertion. To prevent it, now IPv4 DAD is configured in each Address object belogs to Link object.
When the MAC address of a link is updated, an address on the link may be under checking address duplication. Or, (currently such code is not implemented yet, but) address duplication check may be restarted later. For that case, the IPv4 ACD clients must use the new updated MAC address.
For IPv6 case, use RT_SCOPE_HOST only when scope is not explicitly specified.
Previously, address_establish() took Address object stored in Network object. And address_release() took Address object stored in Link object. Thus, address_release() always did nothing.
As 'verify' implies a boolean result.
We usually disable IPv6AcceptRA= if the test does not require any dynamic address configuration, as it makes slightly slow down the test. C.f. 491b79a.
ba4677f to
6649345
Compare
|
@keszybz Thank you for reviewing such a huge PR. Most suggestions are applied. For others, please see the above comments. PTAL. |
|
LGTM. |
The usual: "empty string" is meaningless in this context. We are not assigning DestinationPort="". Just say "unset". Fixes systemd#17240.
When set to "kernel", systemd is not supposed to touch that sysctl. e0534f1c13cd50ec2b143a8b18156cd37e502f7, part of systemd#17240 forgot to handle that case. Fixes systemd#18003
When set to "kernel", systemd is not supposed to touch that sysctl. 5e0534f, part of systemd#17240 forgot to handle that case. Fixes systemd#18003
The usual: "empty string" is meaningless in this context. We are not assigning DestinationPort="". Just say "unset". Fixes systemd#17240. (cherry picked from commit e6fd398)
When set to "kernel", systemd is not supposed to touch that sysctl. 5e0534f, part of systemd/systemd#17240 forgot to handle that case. Fixes systemd/systemd#18003 (cherry picked from commit d3ccb1b)
When set to "kernel", systemd is not supposed to touch that sysctl. 5e0534f, part of systemd/systemd#17240 forgot to handle that case. Fixes systemd/systemd#18003 (cherry picked from commit d3ccb1b)
Most commits should be trivial, they move functions from networkd-link.c or networkd-manager.c to relevant files, or drop redundant or unused entries.
I hope only last few commits fix some minor issues.