Repository navigation
network: sync link state file on dbus call, and ndisc cleanups - #16532
Conversation
|
9f99864 to
8286351
Compare
|
@mrc0mmand Thanks! I hope now it is fixed. |
8286351 to
fe10ed8
Compare
|
@poettering Thank you for your review. I've addressed all your comments. PTAL. |
keszybz
left a comment
There was a problem hiding this comment.
Hmm, I'm a bit confused here. I would expect a memory leak to happen in the last test, but the CI passes. Either the CI does not test this particular code path under valgrind, or my understanding of the code is wrong.
There was a problem hiding this comment.
set_put returns 0 when the item is already in the set, and 1 when it is not. So the check for -EEXIST is not doing the right thing.
There was a problem hiding this comment.
If I understand correctly...
set_putreturns 0 when the item is already in the set, and 1 when it is not.
Right.
So the check for -EEXIST is not doing the right thing.
But set_put() returns -EEXIST if the set contains an element whose hash value is equivalent to the new one. So, I think in this case checking -EEXIST is correct. No?
There was a problem hiding this comment.
From the log in systemd-networkd-tests.py NetworkdRATests.test_ipv6_token_static_multiple
systemd-networkd[862770]: /run/systemd/network/ipv6-prefix-veth-token-static-multiple.network:7: IPv6 token '::1a:2b:3c:4d' is duplicated, ignoring: File exists
systemd-networkd[862770]: /run/systemd/network/ipv6-prefix-veth-token-static-multiple.network:8: IPv6 token '::1a:2b:3c:4d' is duplicated, ignoring: File exists
So, the check -EEXIST works correctly.
There was a problem hiding this comment.
Ah... ordered_set_put() is a wrapper of hashmap_put(). But set_put() is not... Ugh.
There was a problem hiding this comment.
So, you are right here, as here we use set_put().
There was a problem hiding this comment.
But here, the code is correct, as this is ordered_set_put().
There was a problem hiding this comment.
Hmmm, see test-ordered-set.c, test_set_put(). The return value is 0.
There was a problem hiding this comment.
Right, so we get -EEXIST because ipv6_token_hash_ops != trivial_hash_ops`. I think we should fix this at some point, but not in this PR.
This also changes the stored type from int to uint8_t in order to make hash value endianness independent.
fe10ed8 to
5984396
Compare
The Address objects in the set generated by ndisc_router_generate_addresses() have the equivalent prefixlen, flags, prefered lifetime. This commit makes ndisc_router_generate_addresses() return Set of in6_addr.
5984396 to
7f8c1e9
Compare
keszybz
left a comment
There was a problem hiding this comment.
LGTM. There's some things to potentially change in the future, but the code is OK as is.
| if (!in) | ||
| return; | ||
|
|
||
| siphash24_compress(in, strlen(in), state); |
There was a problem hiding this comment.
I'm wondering if this should be strlen() + 1 so that the result for NULL and "" is different.
No description provided.