Yu Watanabe
13ffa39f8e
network: rename network_verify_xxx() -> network_drop_invalid_xxx()
...
As 'verify' implies a boolean result.
2020-10-07 03:22:03 +09:00
Yu Watanabe
494b6b43cb
network: fix masquerade setting logic
...
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.
2020-10-07 03:13:26 +09:00
Yu Watanabe
cd1caf30c0
network: always use RT_SCOPE_HOST for IPv4 loopback addresses
...
For IPv6 case, use RT_SCOPE_HOST only when scope is not explicitly specified.
2020-10-07 03:13:18 +09:00
Yu Watanabe
d93d655c40
network: update MAC address in IPv4 ACD clients
...
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.
2020-10-07 02:59:34 +09:00
Yu Watanabe
490ccbd5e5
network: configure IPv4 DAD per link address
...
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.
2020-10-07 02:57:58 +09:00
Yu Watanabe
693ec5ca83
network: constify one argument
2020-10-07 02:57:54 +09:00
Yu Watanabe
cde1f0e8fc
network: introduce address_copy()
2020-10-07 02:54:01 +09:00
Yu Watanabe
eaff204f09
network: do not update Address::flags in address_configure()
2020-10-07 02:50:51 +09:00
Yu Watanabe
f5ee7d74af
network: fix indentation
2020-10-07 02:50:51 +09:00
Yu Watanabe
4cf8500067
network: use sd_event stored in Manager
2020-10-07 02:50:51 +09:00
Yu Watanabe
51f5dfd8ba
network: move link_enumerate_ipv6_tentative_addresses()
2020-10-07 02:50:51 +09:00
Yu Watanabe
bfbf150ee6
network: manage address pools by OrderedSet
2020-10-07 02:50:50 +09:00
Yu Watanabe
ed76f58521
network: move functions related to address pool
2020-10-07 02:50:50 +09:00
Yu Watanabe
093e35334d
network: header cleanup
2020-10-07 02:50:50 +09:00
Yu Watanabe
67a58eb378
network: make several functions static
2020-10-07 02:50:50 +09:00
Yu Watanabe
aa651e88de
network: manage addresses from pool by Set
2020-10-07 02:50:50 +09:00
Yu Watanabe
9cd9fc8f44
network: drop list of static addresses
...
[Address] sections are managed by both LIST and Hashmap. Let's drop the
list and manage them by OrderedHashmap.
2020-10-07 02:50:50 +09:00
Yu Watanabe
7818f8589a
network: make address_free() return NULL
2020-10-07 02:50:50 +09:00
Yu Watanabe
2488e4d934
network: introduce link_stop_ipv4_dad()
2020-10-07 02:50:50 +09:00
Yu Watanabe
b87d6a8284
network: move link_configure_ipv4_dad()
2020-10-07 02:50:50 +09:00
Yu Watanabe
da4d3a612d
network: introduce link_deserialize_addresses()
2020-10-07 02:50:50 +09:00
Yu Watanabe
3b31e2b718
network: introduce link_serialize_addresses()
2020-10-07 02:50:50 +09:00
Yu Watanabe
32400c2ff0
network: introduce network_verify_addresses()
2020-10-07 02:50:50 +09:00
Yu Watanabe
9a0ad16b26
network: update log messages
...
And drop unnecessary log for in_addr_to_string(), as its result is used
only for the consequent logs.
2020-10-07 02:49:17 +09:00
Yu Watanabe
e1fc2c4371
network: move manager_rtnl_process_address()
2020-10-07 02:44:43 +09:00
Yu Watanabe
d7fbb9f50c
network: introduce link_drop_addresses()
2020-10-07 02:44:43 +09:00
Yu Watanabe
f8f2f880d4
network: introduce link_drop_foreign_addresses()
2020-10-07 02:44:43 +09:00
Yu Watanabe
682c65b04c
network: introduce link_set_addresses()
2020-10-07 02:44:43 +09:00
Zbigniew Jędrzejewski-Szmek
90e74a66e6
tree-wide: define iterator inside of the macro
2020-09-08 12:14:05 +02:00
Yu Watanabe
50550722e3
network: fix NDisc handling for the case when multiple routers exist
...
69203fba70
does not consider the case that
multiple routers exist, and causes #16719 .
Fixes #16719 .
2020-09-08 02:30:04 +09:00
Yu Watanabe
99a2878457
network: expose address_{hash,compare}_func()
2020-09-08 02:30:04 +09:00
Yu Watanabe
fb282d4e25
network: only process non-error message
2020-08-08 12:31:12 +09:00
Yu Watanabe
ea121d8f25
network: update address infomation even if link is in failed or linger state
...
As the link may be reconfigured later. If we do not update the address
information, then its setup state or operstate may not be updated
correctly.
2020-07-29 02:05:05 +09:00
Yu Watanabe
e55265184b
network: do not assume static addresses are configured
...
link_request_set_routes() is also called when a dynamic address is
configured. At that time, static addresses may not be configured yet.
Fixes #16546 .
2020-07-29 02:05:05 +09:00
Yu Watanabe
1633c45731
network: dhcp6: drop addresses and delegated prefixes on client stop
...
Previously, we did not drop addresses and delegated prefixes when
DHCP6 client is stopped.
Fixes #15455 .
Fixes #13564 .
2020-07-29 02:05:05 +09:00
Yu Watanabe
69203fba70
network: ndisc: remove old addresses and routes after at least one SLAAC address becomes ready
...
Otherwise, the old addresses will exist in deperecated state.
2020-07-29 02:05:05 +09:00
Yu Watanabe
6e537f62d7
network: dhcp4: release old lease after the new address become ready
...
Previously, on DHCPv4 address renewal, the old address may be removed
while the new address is not ready yet.
This also simplifies the logic of removing address and routes.
2020-07-29 02:05:05 +09:00
Yu Watanabe
80b0e86084
network: make address/route_configure optionally return created Address/Route object
2020-07-29 02:05:05 +09:00
Yu Watanabe
8eec0b9da5
network: set key destructor in several hash_ops
2020-07-29 02:05:05 +09:00
Yu Watanabe
97f000744f
network: introduce callback called when an address becomes ready
2020-07-29 02:05:00 +09:00
Yu Watanabe
3606ca659e
network: add debug log for configuring address
2020-07-29 01:50:54 +09:00
Yu Watanabe
5eec0a0810
network: introduce address_exists() helper function
2020-07-18 05:51:41 +09:00
Yu Watanabe
d96edb2c6e
network: downgrade log level in conf parsers
2020-07-17 00:40:09 +09:00
Yu Watanabe
93b0b88c3a
network: free address when it is removed
2020-07-15 17:15:25 +09:00
Zbigniew Jędrzejewski-Szmek
de7fef4b6e
tree-wide: use set_ensure_put()
...
Patch contains a coccinelle script, but it only works in some cases. Many
parts were converted by hand.
Note: I did not fix errors in return value handing. This will be done separate
to keep the patch comprehensible. No functional change is intended in this
patch.
2020-06-22 16:32:37 +02:00
Zbigniew Jędrzejewski-Szmek
10b20e5a93
network: allow empty assignment to PreferredLifetime=
...
Users might want to use that to unset a previous setting. The docs seem OK as
they are: we don't need to explictly mention the empty value, since it is
almost always allowed.
2020-05-25 14:52:04 +02:00
Zbigniew Jędrzejewski-Szmek
d273579667
network: use consistent type when parsing lifetimes
...
Those fields are both uint32_t, so we should use the same type when parsing.
Having a different type didn't change the result, but let's be consistent.
2020-05-25 14:52:00 +02:00
Susant Sahani
5ead535224
network: Introduce method to generate EUI-64 addresses
2020-03-01 00:16:51 +09:00
Yu Watanabe
07336a0672
network: assume Scope=host when Address= is loopback address
...
Fixes #14903 .
2020-02-28 09:53:36 +01:00
Kevin P. Fleming
8a98f11ed0
network: Make address_hash_ops available outside of networkd-address.c
...
In order to allow other parts of systemd-networkd to use sets/hashmaps
of Address objects, the address_hash_ops structure needs to be made
available to them.
2020-02-10 15:37:37 +09:00