Yu Watanabe
2ac7eec3b5
network: fix use of uninitialized value
...
Follow-up for 6e537f62d7 .
2020-07-30 07:38:18 +02:00
Yu Watanabe
c05b8edde0
NEWS: mention about [DHCPv6PrefixDelegation] section
...
Follow-up for 99e015e28c .
2020-07-30 04:39:53 +09:00
Yu Watanabe
99e015e28c
network: rename settings about DHCPv6 Prefix Delegation
...
Closes #16602 .
2020-07-29 05:50:08 +09:00
Yu Watanabe
61c0ef4ff3
network: make RADVPrefixDelegation enum bitfield
...
This should not change any behavior.
2020-07-29 05:09:42 +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
15797d6a2b
network: check at least one dynamic address is assigned when DHCP is enabled
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
1c09d84e42
network: rename ipv4ll_address -> ipv4ll_address_configured
2020-07-29 02:05:05 +09:00
Yu Watanabe
b0b9776656
network: ndisc: also remove old DNSSL or RDNSS records after an SLAAC address is ready
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
5f58af25e6
network: make link_check_ready() return earlier if the link is not in 'configuring' state
2020-07-29 02:05:05 +09:00
Yu Watanabe
3336e946da
network: ndisc: do not set configured flags when addresses or routes are not assigned yet
...
Just for safety.
2020-07-29 02:05:05 +09:00
Yu Watanabe
5d8c3ec1e9
network: make link enter failed state if address_update() failed
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
c9d223e803
test-network: add tests for prefix routes
2020-07-29 01:50:54 +09:00
Yu Watanabe
3606ca659e
network: add debug log for configuring address
2020-07-29 01:50:54 +09:00
Yu Watanabe
f527c6fa08
resolvectl: fix older resolved or networkd support to set DNS servers
...
Fixes #16573 .
2020-07-26 11:05:06 +02:00
Yu Watanabe
e128723dae
Merge pull request #16566 from poettering/nspawn-osrelease-fixes
...
nspawn: os-release reorganization, second try
2020-07-24 13:37:31 +09:00
Yu Watanabe
a8bd4bab75
Merge pull request #16567 from keszybz/more-news
...
NEWS and hwdb update for v246-rc2
2020-07-24 13:35:09 +09:00
Yu Watanabe
6f5d73aba6
network: compare with peer address if it is specified
...
Follow-ups for dfef713f3e .
2020-07-23 16:37:56 +02:00
Yu Watanabe
2645d4bcc1
test: clarify that ordered_set_put() returns -EEXIST if entry is duplicated
2020-07-23 21:29:32 +09:00
Yu Watanabe
7f8c1e95a5
test-network: add test for duplicated IPv6Token=
2020-07-22 20:26:11 +09:00
Yu Watanabe
2c62149509
network: ndisc: ignore duplicated IPv6Token=
2020-07-22 20:26:11 +09:00
Yu Watanabe
92ee90af47
network: ndisc: do not store duplicated data in Set
...
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.
2020-07-22 20:26:05 +09:00
Yu Watanabe
3dbd8a15d5
util: use IN6_ARE_ADDR_EQUAL() macro
2020-07-22 19:55:15 +09:00
Yu Watanabe
f91b234077
test-network: drop unnecessary sleep() in NetworkdStateFileTests.test_state_file
2020-07-22 19:55:15 +09:00
Yu Watanabe
1b14222124
network: make bus methods sync link state file
2020-07-22 19:55:15 +09:00
Yu Watanabe
c2a6595014
network: introduce link_save_and_clean()
2020-07-22 19:55:14 +09:00
Yu Watanabe
f281fc1e95
tree-wide: use siphash24_compress_string() where it is applicable
2020-07-22 19:55:14 +09:00
Yu Watanabe
1c568d65ac
util: introduce siphash24_compress_string()
2020-07-22 19:55:14 +09:00
Yu Watanabe
6c04fccb1d
util: make siphash24_compress_boolean() inline
...
This also changes the stored type from int to uint8_t in order to make
hash value endianness independent.
2020-07-22 19:55:14 +09:00
Yu Watanabe
28266c446a
udev: drop unnecessary checks
...
Also, drop one unnecessary sd_device_unref(), as dev_db_clone will be
unref()ed in udev_event_free().
2020-07-21 11:55:28 +09:00
Yu Watanabe
ae353ec2f6
udev: save ID_RENAMING= property to database before renaming network interface
2020-07-21 11:55:28 +09:00
Yu Watanabe
1cdea1a2f7
network: update one log message
2020-07-21 11:55:28 +09:00
Yu Watanabe
711dd5db9e
man: update explanation about the format to specify DNS servers
2020-07-21 04:12:16 +09:00
Yu Watanabe
a574b7d152
resolvectl: use bus_message_read_in_addr_auto()
2020-07-21 04:12:11 +09:00
Yu Watanabe
7695e2cbbe
network, resolve: use bus_message_read_ifindex() or friends
2020-07-21 04:08:22 +09:00
Yu Watanabe
3dd95ab6c5
util: introduce bus_message_read_ifindex()
2020-07-21 04:08:22 +09:00
Yu Watanabe
10d4620467
util: introduce bus_mesage_read_dns_servers()
2020-07-21 04:08:22 +09:00
Yu Watanabe
976009897b
util: introduce helper functions to read in_addr from bus message
2020-07-21 04:08:22 +09:00
Yu Watanabe
e293e755d5
util: drop duplicated inclusion of sd-bus.h
2020-07-21 04:08:22 +09:00
Yu Watanabe
66479677a9
test-network: add tests for DNS= with port number and SNI
2020-07-21 04:08:22 +09:00
Yu Watanabe
a747e71c56
resolvectl: show DNS servers with port and SNI
2020-07-21 04:08:22 +09:00
Yu Watanabe
b1881e8320
resolvectl: make DNS servers can be specified with port number and SNI
2020-07-21 04:08:22 +09:00
Yu Watanabe
8e56ea4c88
resolve: add DBus properties which support DNS SNI and port number
2020-07-21 04:08:22 +09:00
Yu Watanabe
95ce1ba87b
resolve: add DBus method to set DNS server with port number and SNI
2020-07-21 04:08:22 +09:00
Yu Watanabe
4e11ddfdd3
network: add DBus method to set DNS server with port number and SNI
2020-07-21 04:08:22 +09:00
Yu Watanabe
87d6489776
network: save DNS servers specified by DBus interface
...
Also, filter out DNS servers which do not match link ifindex.
2020-07-21 04:08:22 +09:00
Yu Watanabe
6458176514
network: do not save DNS= entries not match link ifindex
2020-07-21 04:08:22 +09:00
Yu Watanabe
e77bd3fdff
network: support port number and SNI in [Network] DNS=
2020-07-21 04:08:22 +09:00
Yu Watanabe
8aa5afd20f
resolve: read/save port number and SNI from/into link state file
2020-07-21 04:08:16 +09:00
Yu Watanabe
b6af282475
resolve: compare port and SNI in dns_server_hash_ops
2020-07-21 04:04:49 +09:00
Yu Watanabe
1b86009298
resolve: also compare port and SNI in dns_server_find()
2020-07-21 04:04:49 +09:00
Yu Watanabe
da9de7385a
resolve: support port specifier in DNS= setting
2020-07-21 04:04:42 +09:00
Yu Watanabe
395aa34023
resolve: ignore empty server name
...
Just for safety.
2020-07-21 03:55:34 +09:00
Yu Watanabe
408f8fbc0f
util: introduce 'struct in_addr_full' and its helper functions
2020-07-21 03:55:34 +09:00
Yu Watanabe
a723fb85da
util: introduce in_addr_port_ifindex_name_from_string_auto() and in_addr_port_ifindex_name_to_string()
2020-07-21 03:55:34 +09:00
Yu Watanabe
cbe194b39e
resolve: propagate error in link_load_user()
...
Most error path in link_load_user() are ENOMEM. Hence, it is critical.
2020-07-21 03:55:34 +09:00
Yu Watanabe
eced0d2a46
Merge pull request #16518 from yuwata/network-fix-failure-in-updating-mac-address
...
network: fix failures in updating MAC address
2020-07-21 02:13:24 +09:00
Yu Watanabe
807667f7ac
network: stop already running engines before updating MAC address
...
In NetworkdBridgeTests.test_bridge_configure_without_carrier of
systemd-networkd-tests.py
```
bridge99: MAC address: 2e:3a:ec:4d:d3:62
Assertion 'sd_ipv4ll_is_running(ll) == 0' failed at src/libsystemd-network/sd-ipv4ll.c:110, function int sd_ipv4ll_set_mac(sd_ipv4ll *, const struct ether_addr *)(). Ignoring.
bridge99: Could not update MAC address in IPv4LL client: Device or resource busy
```
2020-07-20 15:29:55 +09:00
Yu Watanabe
96fe813c42
radv: introduce sd_radv_is_running()
2020-07-20 15:29:12 +09:00
Yu Watanabe
48c5398951
networkctl: do not ignore -EOPNOTSUPP when reading netlink message
...
If the kernel does not support alternative interface names, then
sd_netlink_message_read_strv() should just return -ENODATA.
2020-07-20 15:24:40 +09:00
Yu Watanabe
ae5b779252
networkctl: sort alternative names
2020-07-20 15:24:40 +09:00
Yu Watanabe
628f08b66d
sd-netlink: make timeout message sealed
...
When sd_netlink_call_async() timed out, then we reply the synthetic
error message, but it was not sealed. So, reading the message causes
the following assertion:
```
Assertion 'm->sealed' failed at src/libsystemd/sd-netlink/netlink-message.c:652, function netlink_message_read_internal(). Ignoring.
```
2020-07-20 07:49:55 +02:00
Yu Watanabe
4573592ddf
Merge pull request #16512 from keszybz/offline-passwd-altfiles
...
Support alternate passwd/group locations in tmpfiles
2020-07-19 06:46:05 +09:00
Yu Watanabe
0119ab3d6c
Merge pull request #16476 from keszybz/qemu-autosuspend-rules
...
Add autosuspend rules for emulated QEMU devices
2020-07-18 09:10:20 +09:00
Yu Watanabe
a8c10331b4
network: replace NDISC -> NDisc in log messages
2020-07-18 05:51:41 +09:00
Yu Watanabe
5eec0a0810
network: introduce address_exists() helper function
2020-07-18 05:51:41 +09:00
Yu Watanabe
d15818f227
network: update debug log when foreign routes are received with ManageForeignRoutes=no
2020-07-18 05:51:41 +09:00
Yu Watanabe
5ff1ef31f2
network: do not enumerate routes if ManageForeignRoutes=no
2020-07-18 05:51:32 +09:00
Yu Watanabe
97fdae33df
udev: do not try to reassign alternative names
...
Setting alternative names may fail if some of them are already assigned.
2020-07-17 21:36:11 +09:00
Yu Watanabe
434a348380
netlink: do not fail when new interface name is already used as an alternative name
...
When renaming a network interface, the new name may be used as an
alternative name. In that case, let's swap the current name and the
alternative name. That is, first drop the new name from the list of
alternative names, then rename the interface, finally set the old name
as an alternative name.
2020-07-17 21:31:47 +09:00
Yu Watanabe
1498252614
netlink: introduce rtnl_get/delete_link_alternative_names()
2020-07-17 21:29:13 +09:00
Yu Watanabe
7f16ef9fba
Merge pull request #16490 from yuwata/network-radv-ndisc-cleanups
...
network: cleanups for radv and ndisc
2020-07-17 15:12:53 +09:00
Yu Watanabe
94ec163ad2
timedatectl: do not show (null) if the address of NTP server is not resolved
2020-07-17 03:10:42 +09:00
Yu Watanabe
13e8a49a58
network: ndisc: any failures in processing event make the link in failed state
...
Also adjust log levels.
2020-07-17 01:18:44 +09:00
Yu Watanabe
c97785168b
network: radv: clean up conf parsers
2020-07-17 01:16:38 +09:00
Yu Watanabe
d96edb2c6e
network: downgrade log level in conf parsers
2020-07-17 00:40:09 +09:00
Yu Watanabe
9e54462cd5
Merge pull request #16482 from poettering/coverity-246
...
two coverity fixes
2020-07-16 20:23:23 +09:00
Yu Watanabe
0ded0e40ab
dhcp4: only renewing lease when the client already has a lease
...
Follow-up for ceaec54a3c .
Hopefully fixes #16299 .
2020-07-16 14:58:54 +09:00
Yu Watanabe
f766d9af38
network: dhcp4: add two warnings
2020-07-16 10:54:16 +09:00
Yu Watanabe
153cf04139
network: dhcp4: fix another race with SendDecline=yes
...
If the SD_IPV4ACD_EVENT_BIND event happens before all routes are
assigned, then the link stuck in configuring state.
2020-07-16 10:54:08 +09:00
Yu Watanabe
75be72d139
network: dhcp4: also release old lease in dhcp_lease_lost()
...
The lease lost may happen during renewing address. If it happens,
assertion hits in dhcp4_release_old_lease().
2020-07-16 10:51:46 +09:00
Yu Watanabe
43bf28741f
network: drop doubled white space
2020-07-15 17:15:25 +09:00
Yu Watanabe
93b0b88c3a
network: free address when it is removed
2020-07-15 17:15:25 +09:00
Yu Watanabe
6906794dd1
network: dhcp4: do not assign new address before old one is not removed
...
If DHCP4 client lost a lease, and then soon acquire new lease, then
the removal of the old address may not be completed. If that happens,
and the new and old addresses are the same, then the new address will be
considered as a foreign address. Such a situation can occur when the
DHCP4 server is restarted.
This makes networkd wait for the removal of the old address when a new
lease is acquired.
This also makes the link in configuring state when renewing address.
2020-07-15 17:15:25 +09:00
Yu Watanabe
5d976f5f64
network: do not call link_check_ready() in link_request_set_routing_policy_rule()
...
It will be called in link_request_set_nexthop() or serveral handlers().
2020-07-15 17:15:25 +09:00
Yu Watanabe
0c816fcc7b
network: make link_request_set_nexthop() called from link_request_set_routes() or route_handler()
...
Then we can drop static_routes_ready() flag.
2020-07-15 17:15:25 +09:00
Yu Watanabe
659ad3a0af
network: do not make link in configured state when no address is assigned
...
When DHCP6 and RA are enabled, and RA does not provide any addresses,
then link may become configured state even if no address is assigned,
due to the time-lag between RA completion and DHCP reply.
This makes if DHCP is explicitly enabled, then link must have at least
one valid address to be in the configured state.
2020-07-15 17:15:25 +09:00
Yu Watanabe
d98c546dac
network: ndisc: split ndisc_configured flag into for addresses and routes
2020-07-15 17:15:25 +09:00
Yu Watanabe
01c344bdd4
network: ndisc: do not ignore remaining addresses
...
Follow-up for c24c83dc67 .
2020-07-15 17:15:25 +09:00
Yu Watanabe
571f953934
test-network: wait for addresses are not in tentative state
2020-07-15 17:15:25 +09:00
Yu Watanabe
39373cb984
network: add debugging log why link is not in configured state yet
2020-07-15 17:15:16 +09:00
Yu Watanabe
c5fcd8a70a
test-network: check assigned address is not tentative state
2020-07-15 17:14:30 +09:00
Yu Watanabe
491b79aeac
test-network: set IPv6AcceptRA=no if no dynamic addresses are not required
2020-07-15 17:14:30 +09:00
Yu Watanabe
eb01a2dfb1
network: make link_request_set_nexthop() static
2020-07-15 17:14:30 +09:00