Skip to content

Conversation

@yuwata
Copy link
Member

@yuwata yuwata commented Oct 4, 2020

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.

@yuwata yuwata force-pushed the network-cleanup branch 8 times, most recently from 3518bd8 to 4170786 Compare October 4, 2020 21:57
@yuwata yuwata force-pushed the network-cleanup branch 2 times, most recently from 2af5f84 to ba4677f Compare October 5, 2020 21:36
@keszybz keszybz closed this in e6fd398 Oct 6, 2020
@yuwata yuwata reopened this Oct 6, 2020
Copy link
Member

@keszybz keszybz left a 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) \
Copy link
Member

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?

Copy link
Member Author

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;
}
Copy link
Member

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;
}

?

Copy link
Member Author

@yuwata yuwata Oct 6, 2020

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.

yuwata added 12 commits October 7, 2020 02:54
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.
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.
@yuwata
Copy link
Member Author

yuwata commented Oct 6, 2020

@keszybz Thank you for reviewing such a huge PR. Most suggestions are applied. For others, please see the above comments. PTAL.

@keszybz keszybz added good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed and removed good-to-merge/with-minor-suggestions labels Oct 6, 2020
@keszybz
Copy link
Member

keszybz commented Oct 6, 2020

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed network sd-netlink