Yu Watanabe
ca6bc7ce0d
Merge pull request #20226 from yuwata/network-introduce-source-and-status
...
network: introduce NetworkConfigSource and NetworkConfigState
2021-09-30 00:06:17 +09:00
Yu Watanabe
faa2e64f9b
network: do not configure anything when running in test mode
2021-09-29 20:50:37 +09:00
Yu Watanabe
4c78dc17e5
network: do not update state files when running in test mode
...
Fixes #20862 .
2021-09-29 20:50:37 +09:00
Yu Watanabe
96f5f9ef9a
network: receive genl multicast messages about wlan connections
2021-09-29 15:56:20 +09:00
Yu Watanabe
f12629ae38
network: move error handling of enumerating configs to caller side
2021-09-29 15:56:09 +09:00
Yu Watanabe
bdcd4ab2f1
network: make manager_enumerate_internal() take sd_netlink object
...
Preparation for dumping information through generic netlink.
2021-09-29 15:38:59 +09:00
Yu Watanabe
96243149bd
network: split manager_new() into two part
...
Initialize dbus or netlink is not necessary for fuzzers.
2021-09-29 15:38:59 +09:00
Yu Watanabe
77f75f4fff
network: rename wifi_iftype -> wlan_iftype
2021-09-29 15:38:59 +09:00
Yu Watanabe
01afd0f7f5
tree-wide: make format_ifname() or friends return negative errno on failure
...
Also,
- drop unnecessary +1 from buffer size, as IF_NAMESIZE or IFNAMSIZ
includes the nul at the end.
- format_ifname() does not update buffer on failure,
- introduces format_ifname_alloc(), FORMAT_IFNAME(), and their friends.
2021-09-29 03:37:06 +09:00
Yu Watanabe
c01b9b879c
network: use sd-lldp-tx
2021-09-28 01:35:51 +09:00
Yu Watanabe
3be1e84fe9
sd-lldp: introduce SD_LLDP_OUI_IANA_MUD macro
2021-09-28 01:34:00 +09:00
Yu Watanabe
35778343ab
sd-lldp-rx: rename sd_lldp -> sd_lldp_rx
2021-09-27 23:55:11 +09:00
Yu Watanabe
3a2ee8554e
sd-lldp: rename sd-lldp.[ch] -> sd-lldp-rx.[ch]
2021-09-27 23:55:11 +09:00
Yu Watanabe
b4c7934a3c
network: drop unnecessary link_drop_foreign_config()
...
Now, link_drop_foreign_config() drops subset of configs which can be
dropped by link_drop_config().
2021-09-24 21:46:36 +09:00
Yu Watanabe
b8355de49e
network: drop unused features in request queue
2021-09-24 21:46:36 +09:00
Yu Watanabe
b87e96e2f2
network: address_equal() is not used anymore, hence move it to test-network.c
2021-09-24 21:46:36 +09:00
Yu Watanabe
3b6a3bdebf
network: use NetworkConfigSource/State to manage addresses and routes
...
This also fixes #20146 .
2021-09-24 21:46:32 +09:00
Yu Watanabe
d105befc97
network: disable event sources before unref them
2021-09-24 17:26:10 +09:00
Yu Watanabe
73bf0f2ace
Merge pull request #20738 from mrc0mmand/ci-llvm-13
...
ci: build with clang-13
2021-09-16 09:32:21 +09:00
Frantisek Sumsal
d7ac09520b
tree-wide: mark set-but-not-used variables as unused to make LLVM happy
...
LLVM 13 introduced `-Wunused-but-set-variable` diagnostic flag, which
trips over some intentionally set-but-not-used variables or variables
attached to cleanup handlers with side effects (`_cleanup_umask_`,
`_cleanup_(notify_on_cleanup)`, `_cleanup_(restore_sigsetp)`, etc.):
```
../src/basic/process-util.c:1257:46: error: variable 'saved_ssp' set but not used [-Werror,-Wunused-but-set-variable]
_cleanup_(restore_sigsetp) sigset_t *saved_ssp = NULL;
^
1 error generated.
```
2021-09-15 13:09:45 +02:00
Yu Watanabe
89fa013349
network: use NetworkConfigSource/State to manage nexthops
...
This also changes the logic when Id= is not specified.
Previously, kernel picks the lowest unused ID, but now networkd picks
the lowest unused ID.
2021-09-15 16:50:23 +09:00
Yu Watanabe
eb72fa3ad2
network: use NetworkConfigSource/State to manage routing policy rules
...
This also changes the logic when Priority= is not specified.
Previously, we request without FRA_PRIORITY attribute and kernel picks
the highest unused priority for the rule.
This makes networkd picks the highest unused priority and always request
FRA_PRIORITY attribute.
2021-09-15 16:50:23 +09:00
Yu Watanabe
193c4af94b
network: use NetworkConfigSource/State to manage neighbors
2021-09-15 16:50:23 +09:00
Yu Watanabe
a093533c33
network: introduce NetworkConfigSource and NetworkConfigState
...
These will be used in later commits.
2021-09-15 16:50:23 +09:00
Yu Watanabe
9d01399d44
network: replace config_parse_address_filter() with config_parse_in_addr_prefixes()
2021-09-14 20:31:17 +09:00
Yu Watanabe
bffaa49ec4
in-addr-prefix-util: introduce several utilities for address prefix
2021-09-14 20:30:09 +09:00
Yu Watanabe
e47bcb7d0b
network: do not use RouteTable= in [DHCPv4] section for DHCPv6 routes
...
We forgot to add RouteTable= in [DHCPv6] section when we split [DHCP]
into two.
2021-09-14 17:51:19 +09:00
Yu Watanabe
967e6a6403
network: use ltype to distinguish DHCPv4 and DHCPv6
2021-09-14 15:21:10 +09:00
Yu Watanabe
471e332d50
network: dhcp4: use free_and_strdup_warn()
2021-09-14 15:21:10 +09:00
Yu Watanabe
ec84bb2a2b
network: dhcp4: log server address
2021-09-14 15:21:10 +09:00
Yu Watanabe
3596fb3600
network: dhcp4: return earlier on failure
2021-09-14 15:21:10 +09:00
Yu Watanabe
429dc05a72
network: move common route settings to {dhcp4,ndisc}_request_route()
2021-09-14 15:21:10 +09:00
Yu Watanabe
ecedc48b19
network: do not drop IPv6LL address in link_drop_addresses()
2021-09-11 10:49:11 +09:00
Yu Watanabe
981fab5d0a
network: always call address ready callback if address is ready
...
The address ready callback is used for cleaning up old addresses or
routes acquired by e.g. DHCP. However, the callback was called only
when the address was previously not ready. So, maybe, unnecessary
addresses or routes may not be cleared.
Also, this makes the callback is called slightly earlier. As it may
remove several addresses or routes, and possibly changes the link state.
2021-09-11 10:49:11 +09:00
Yu Watanabe
18d8a33a37
network: define Address earlier
...
As the type is used in defining address_ready_callback_t.
2021-09-11 10:49:11 +09:00
Yu Watanabe
7657ec3eb8
network: store IPv6LL address even if link is in failed state
...
Otherwise, if IPv6LL is received when the link is in failed state,
we may fail to reconfigure the link.
2021-09-11 10:49:11 +09:00
Yu Watanabe
7a8685ffef
network: enable IP masquerade when address is assigned
...
Previously, IP masquerade is enabled when configuring the address. But,
the request of assigning the address may be refused by kernel.
2021-09-11 10:49:11 +09:00
Yu Watanabe
2c40a8895e
network: simplify code a bit
2021-09-11 10:49:11 +09:00
Luca Boccassi
c54e851acb
Merge pull request #20699 from yuwata/network-drop-foreign
...
network: do not drop foreign configs when carrier of unmanaged interface is lost
2021-09-10 21:10:58 +01:00
Luca Boccassi
992fccd411
Merge pull request #20702 from yuwata/network-trivial-cleanups
...
network: several trivial cleanups
2021-09-10 21:10:40 +01:00
Yu Watanabe
160203e974
network: fix handling of network interface renaming
...
Fixes #20657 .
2021-09-10 20:49:05 +02:00
Yu Watanabe
995cc7a72c
network: drop unused "after_configure" feature for nexthops, neighbors, and routing policy rules
2021-09-10 19:40:27 +09:00
Yu Watanabe
f1c22cf4da
network: do not try to drop addresses or routes of unmanaged interfaces on carrier lost
...
Currently, link_stop_engines(), link_drop_config(), and link_drop_foreign_config()
do nothing when the interface is unmanaged. So this does not change anything.
But returning earlier should be clear and safer for protecting configs
on unmanaged interfaces.
2021-09-10 19:40:27 +09:00
Yu Watanabe
dbf8942ab9
network: introduce route_by_kernel() helper function
...
And drop "FIXME" from comment, as there is nothing we need to fix.
2021-09-10 17:06:24 +09:00
Yu Watanabe
86173383a3
network: introduce ipv4acd_set_ifname()
2021-09-10 17:06:24 +09:00
Yu Watanabe
fccf662c3f
network: use sd_netlink_message_read_string_strdup()
2021-09-10 17:06:24 +09:00
Yu Watanabe
771a36439e
network: fix wrong flag: manage_foreign_routes -> manage_foreign_rules
...
Fixes a bug in d94dfe7053 .
2021-09-07 20:00:18 +01:00
Yu Watanabe
57aef9d737
network: introduce KeepMaster= setting
...
Closes #20624 .
2021-09-04 00:23:20 +09:00
Yu Watanabe
1f024462d1
network: assume enslaved when master ifindex is positive
2021-09-04 00:20:36 +09:00
Yu Watanabe
571bf1aa31
network: use master ifindex to check if the interface is enslaved
2021-09-04 00:20:36 +09:00