Zbigniew Jędrzejewski-Szmek
51762897c6
network: adjust log message about MACsec associations
2022-01-05 11:45:11 +01:00
Zbigniew Jędrzejewski-Szmek
9e369704a8
network: simplify logging in macsec netdev code
2022-01-05 11:43:36 +01:00
Zbigniew Jędrzejewski-Szmek
b471fc9456
network: simplify logging in l2tp_create_session() and l2tp_create_tunnel()
...
All the detailed logging is replaced by a simple "Failed to create netlink message",
which should be enough for the user in the unlikely case that this ever fails.
2022-01-05 11:43:36 +01:00
Zbigniew Jędrzejewski-Szmek
eff692502b
network: move logging from ipoib_set_netlink_message() to the caller
2022-01-05 11:43:28 +01:00
Zbigniew Jędrzejewski-Szmek
2f64865b0e
network: split out netdev_fill_fou_tunnel_message(), simplify logging
2022-01-05 11:41:29 +01:00
Zbigniew Jędrzejewski-Szmek
0c50cb50bd
network: split out netdev_create_message(), simplify logging
2022-01-05 11:41:29 +01:00
Zbigniew Jędrzejewski-Szmek
81f01be0b8
network: replace more detailed netlink append messages
...
Some refactoring was needed here to avoid duplicate messages.
Some select-and-paste errors were fixed on the way.
systemd-networkd is thinner by 8k.
2022-01-05 11:41:29 +01:00
Zbigniew Jędrzejewski-Szmek
d15cba9647
network: use SYNTHETIC_ERRNO in one more place
2022-01-05 11:41:29 +01:00
Zbigniew Jędrzejewski-Szmek
5b80ecea55
network: replace detailed netlink append messages with a single generic message
...
This commit is the first in the series, and they generally follow the same
idea: we had very detailed logging for message append operations which would
only fail either with some type error or intrinsic limit (and then they would
fail everywhere, so this would be noticed during development or in CI), or they
would fail with ENOMEM, in which case the exact location is not very interesting
since this is not repeatable.
I am in general in favour of detailed logging messages, because it helps with
diagnosis of errors, but I think case is an exception. Despite not being very
useful, those messages required a lot of effort, because they were customized
for each and every append operation. In fact some of the messages contained copy
errors. The text of the messages (since they are generally unique) also added up
to a considerable size.
This removes the log messages after each sd_netlink_message_append_*() in
fill_message_create() with a single line in netdev_create(). As described
above, we are just appending fields to a message, so those calls would almost
never fail.
A forgotten 'return' was added in one place.
$ size build/systemd-networkd{.0,}
text data bss dec hex filename
1878634 394016 36 2272686 22adae build/systemd-networkd.0
1842450 394080 36 2236566 222096 build/systemd-networkd
… so we save 30k too.
2022-01-05 11:36:04 +01:00
Yu Watanabe
af670fc635
network: wireguard: warn about invalid allowed IP addresses
...
But handle them gracefully. Otherwise, when the route to the address is
being configured, kernel refuse the route.
Note that kernel's wireguard module handle e.g. 192.168.10.3/24 as
192.168.10.0/24.
Fixes #21929 .
2021-12-31 02:31:09 +09:00
Yu Watanabe
b886649c95
network: vxlan: support to select an address assigned on underlying interface as local address
2021-12-25 15:32:06 +09:00
Yu Watanabe
7726526cc6
Merge pull request #21648 from yuwata/network-tunnel-local-automatic-address-selection
...
network: tunnel: automatic local address selection
2021-12-25 15:05:13 +09:00
Yu Watanabe
fe87807eaa
network: dhcp-pd: do not stack 6rd sit tunnel
2021-12-18 10:09:07 +09:00
Frantisek Sumsal
c0a2e0cc24
network: a couple of tweaks suggested by Coccinelle
2021-12-18 08:36:07 +09:00
Yu Watanabe
2be25d7557
network: tunnel: support to set an address assigned on underlying interface as local address
...
Closes #18732 .
2021-12-12 13:42:45 +09:00
Yu Watanabe
6d1b59cec4
network/netdev: introduce link_get_local_address()
...
It will be used in later commits.
2021-12-12 13:41:48 +09:00
Yu Watanabe
562729d744
network/netdev: introduce .is_ready_to_create() entry in netdev vtable
2021-12-12 13:41:39 +09:00
Zbigniew Jędrzejewski-Szmek
dc79ae23fb
Merge pull request #21664 from yuwata/network-tunnel-cleanups
...
network: several cleanups for tunnel device
2021-12-11 17:17:40 +01:00
Yu Watanabe
bb916f350a
network: call link_check_ready() when all stacked netdevs are created
...
Follow-up for 879377cad5 .
Otherwise, the underlying interface may stuck in configuring state.
2021-12-08 18:40:13 +09:00
Yu Watanabe
a88f3913cf
network: tunnel: unify init functions for tunnels
2021-12-08 01:54:01 +09:00
Yu Watanabe
fbe0139f1a
network: tunnel: introduce TUNNEL() helper function
2021-12-08 01:54:01 +09:00
Yu Watanabe
9e29133085
network: tunnel: create tunnels with AssignToLoopback=yes independently of .network file
2021-12-08 01:54:01 +09:00
Yu Watanabe
e49bad0179
network: dhcp-pd: add 6rd support
...
Closes #19152 .
2021-12-07 20:33:16 +09:00
Yu Watanabe
543240f593
network/netdev: drop spurious state from the condition to create stacked netdevs
...
Stacked netdevs are requested when the underlying interface is in
configuring state.
2021-12-07 15:58:25 +09:00
Yu Watanabe
f7144e7b0f
network/netdev: create stacked netdevs after all set-link operations are finished
...
E.g. setting MAC address must be done before creating VLAN interface.
2021-12-07 15:58:25 +09:00
Yu Watanabe
45aa0e841b
network,udev: do not adjust local assignment bit of specified MAC address
...
People often assigns the MAC address of the enslaved interface to e.g.
bridge interface. So, the local assignment bit should not be adjusted.
Fixes #21649 .
2021-12-07 15:01:04 +09:00
Frantisek Sumsal
c73f413d8d
tree-wide: check for NULLs in more places
...
Fixes issues pointed out by the `cpp/inconsistent-null-check` LGTM
query.
2021-12-06 08:50:53 +09:00
Yu Watanabe
72e65e6ffd
network: add support to configure IPoIB interfaces
2021-12-05 00:18:58 +09:00
Yu Watanabe
b90d0f83b2
network/netdev: add support to create IPoIB subinterface
2021-12-04 15:06:58 +09:00
Yu Watanabe
a8ee2b8e1f
network/netdev: generate persistent MAC address when creating netdev interface
...
Preparation for later commits.
2021-12-04 15:05:32 +09:00
Yu Watanabe
38ef464e41
network/wireguard: search valid address of the endpoint from all struct addrinfo entries
2021-12-02 08:39:37 +09:00
Yu Watanabe
8bf7e3b61c
network/wireguard: cleanups for resolving endpoints
...
This makes
- drop peers_with_unresolved_endpoint and peers_with_failed_endpoint,
- drop destroy handler for sd_resolve_query, and manage each query by peer,
- add random fluctuation to the timeout for retry handler,
- retry timer event source is now managed by peer,
- use sd_event_source_disable_unref().
2021-12-02 08:39:32 +09:00
Yu Watanabe
4a897d29f1
network/wireguard: do not resolve Endpoint= if an IP address is specified
...
Also verify the domain name and port.
2021-12-02 08:36:22 +09:00
Yu Watanabe
e908434458
network: wireguard: automatically configure routes to addresses specified in AllowedIPs=
...
Closes #14176 .
2021-12-01 04:00:11 +09:00
Yu Watanabe
9e11bd58fb
network/wireguard: drop unnecessary .in6 specifier
...
This should not change any behavior, as the size of the IPv4 address is
smaller than IPv6.
2021-12-01 03:56:00 +09:00
Yu Watanabe
5b8bdd20c6
network/netdev: generate persistent MAC address for batadv and bridge
...
This mostly reverts 489f01f806 and
deb2cfa4c6 .
As now MACAddress=none is supported. So, users can still disable MAC
address assignment.
2021-11-28 12:04:55 +09:00
Yu Watanabe
aaa5ca57ae
network/netdev: make MACAddress= take 'none' to suppress generating persistent hardware address
...
This is mostly equivalent to .link file's MACAddressPolicy=none.
2021-11-28 12:04:55 +09:00
Yu Watanabe
5dcc5b1a11
network/netdev: move config_parse_netdev_kind() at the end
2021-11-28 12:04:55 +09:00
Yu Watanabe
007899f43e
network/netdev: verify specified MAC address
...
Drop multicast bit and set local bit of the specified MAC address.
This also makes failure in generating persistent MAC address
non-critical.
2021-11-27 06:39:04 +09:00
Yu Watanabe
5e20e1e3e3
network/netdev: use "struct hw_addr_data" to store MAC address
2021-11-27 06:39:04 +09:00
Yu Watanabe
9f0cf80dd0
network/netdev: introduce .iftype to netdev vtable
...
And disable .generate_mac flag for non-ether interfaces.
2021-11-27 06:38:26 +09:00
Yu Watanabe
a67e0507c3
network: veth: use SYNTHETIC_ERRNO() macro or use real error cause
2021-11-27 06:37:58 +09:00
Yu Watanabe
39b91d1ae4
network: tuntap: drop unnecessary minus
2021-11-16 16:53:43 +01:00
Yu Watanabe
c6df73ca72
ether-addr-util: introduce {hw,ether}_addr_hash_ops_free
2021-11-09 21:39:09 +09:00
Yu Watanabe
aa4f765326
conf-parser: rename config_parse_hwaddr() -> config_parse_ether_addr()
2021-11-09 21:39:09 +09:00
Yu Watanabe
227e9ce255
ether-addr-util: replace ether_addr_from_string() with parse_ether_addr()
2021-11-09 21:39:09 +09:00
Yu Watanabe
bc945c2b42
network/netdev: sort netdev kinds
2021-11-09 16:00:49 +09:00
Yu Watanabe
ad851caebd
network/bridge: drop if_bridge.h from bridge.h
...
To avoid future header conflicts.
2021-11-09 16:00:49 +09:00
Yu Watanabe
fddb337cc8
network/netdev: fix typo
2021-11-09 16:00:49 +09:00
Yu Watanabe
e331889a5e
network: bareudp: use fill_message_create
2021-11-09 16:00:49 +09:00