Yu Watanabe
7033af49df
network: introduce new netdev create type NETDEV_CREATE_AFTER_CONFIGURED
...
It will be used to support L2TP tunnel in later commits.
2019-03-14 10:57:41 +09:00
Yu Watanabe
859e9c0487
network: introduce netdev_get_create_type() helper function
2019-03-14 10:57:41 +09:00
Yu Watanabe
2b6db913e2
network: do not call link_joined() when not all netdevs are configured
...
If some of stacked netdevs are already configured, then link_joined()
is called before netdevs are fully configured.
2019-03-14 10:57:41 +09:00
Zbigniew Jędrzejewski-Szmek
a3b1790c1a
Merge pull request #11986 from poettering/util-split
...
some splitting up of util.[ch]
2019-03-13 17:02:14 +01:00
Tobias Jungel
7f15b71460
networkd: Add bridge port capabilities
...
This PR adds the configuration switches for multicast flooding, neighbor
suppression and learning of a bridge port.
2019-03-13 16:27:22 +01:00
Lennart Poettering
760877e90c
util: split out sorting related calls to new sort-util.[ch]
2019-03-13 12:16:43 +01:00
Lennart Poettering
0a9707187b
util: split out memcmp()/memset() related calls into memory-util.[ch]
...
Just some source rearranging.
2019-03-13 12:16:43 +01:00
Lennart Poettering
96c45cc697
Merge pull request #11861 from yuwata/network-verify-2
...
network: config parser updates and wireguard refactoring
2019-03-13 10:15:27 +01:00
Yu Watanabe
07e1ffe4ae
wait-online: use log_link_debug() or friends
2019-03-13 14:29:03 +09:00
Yu Watanabe
e67ae9f5e6
network: move log_link_debug() or friends to log-link.h
2019-03-13 14:29:03 +09:00
Yu Watanabe
f023184e6d
wait-online: support $REQUIRED_OPER_STATE_FOR_ONLINE= in state file
...
This also make wait-online optionally take operstate in -i option,
and adds '--operstate' option to wait-online which also takes operstate.
Also, this contains huge refactoring for wait-online.
2019-03-13 14:29:03 +09:00
Yu Watanabe
4ac77d63e9
network: make RequiredForOnline= also take operational state
...
This will be used by systemd-networkd-wait-online.
2019-03-13 14:29:03 +09:00
Yu Watanabe
c9cc038343
network: introduce 'degraded-carrier' operstate to order all states
...
Previously, 'degraded' state is ambiguous for bonding or bridge master:
1. one or more slave interfaces does not have carrier,
2. no link local address is assigned to the master,
3. combination of the above two.
This makes the above case 1 and 3 are in the new 'degraded-carrier'
state, and makes 'degraded' state as all slaves are active but no
link local address on master.
2019-03-13 14:29:00 +09:00
Yu Watanabe
2cd6b9326c
network: move LinkOperationalState and relevant functions to network-util.[ch]
2019-03-13 14:28:38 +09:00
Yu Watanabe
76df77794a
wireguard: add PrivateKeyFile= option
...
Closes #11878 .
2019-03-13 12:02:03 +09:00
Yu Watanabe
9cc9021aed
wireguard: check whether PrivateKey= and PublicKey= are set
2019-03-13 11:59:18 +09:00
Yu Watanabe
fedcb4c3eb
wireguard: drop unused arguments and rename parse_wireguard_key()
2019-03-13 11:59:18 +09:00
Yu Watanabe
583eb170f0
wireguard: do not log wireguard key
...
It may be PrivateKey=.
2019-03-13 11:59:18 +09:00
Yu Watanabe
85c987a82d
wireguard: reuse sd_event_source object
2019-03-13 11:59:18 +09:00
Yu Watanabe
f1368a333e
wireguard: use NetworkConfigSection to manage [WireGuardPeer] sections
...
This also contains huge refactoring of wireguard support.
2019-03-13 11:59:18 +09:00
Yu Watanabe
96db641250
test: make network_verify() public and use it in test-networkd-conf
2019-03-13 11:59:18 +09:00
Yu Watanabe
fcbf4cb727
network: drop sections contain invalid settings in network_verify()
...
If e.g., an [Address] section has an invalid setting, then
previously assigned settings in the section is freed, and
only later settings are stored. That may cause partially broken
section stored in Network object.
This makes if an invalid setting is found, then set 'invalid' flag
instead of freeing it. And invalid sections are dropped later by
network_verify().
2019-03-13 11:59:18 +09:00
Yu Watanabe
9560e5b323
network: make all xxx_new_static() static
...
These functions are called from only config parsers, and the parsers are
in the same files. So, let's make them static.
2019-03-13 11:59:18 +09:00
Yu Watanabe
fa7cd7117f
network: add IPv4LL route right after .network file is parsed
...
Previously, the route is added when the .network config is assigned
to a Link. So, if multiple links match the .network file, the route
entry becomes duplicated in the corresponding Network object.
2019-03-13 11:59:18 +09:00
Yu Watanabe
48315d3dca
network: move NetworkConfigSection and related functions to networkd-util.[ch]
2019-03-13 11:59:18 +09:00
Yu Watanabe
95dba43542
network: use ltype to determine netdev kind in config_parse_stacked_netdev()
2019-03-13 11:59:18 +09:00
Yu Watanabe
a7f95575b1
network: use device_get_action()
2019-03-12 03:49:53 +09:00
Clemens Gruber
c423be28a0
network: introduce TripleSampling= option in CAN section
...
When enabled, three samples are used to determine the value of a
received bit by majority rule.
This patch adds support for the TripleSampling= option in the [CAN]
section of .network files.
2019-03-11 17:15:47 +01:00
Yu Watanabe
7750b79695
network: update logs
2019-03-11 08:10:50 +01:00
Yu Watanabe
299ad32d48
network: do not configure interfaces under renaming
2019-03-05 10:33:42 +09:00
Yu Watanabe
30de2b89d1
network: always drop configs when interface is renamed
...
Before the renaming, wrong .network file may be assigned to the link.
So, let's always drop link configuration.
2019-03-05 10:33:27 +09:00
Yu Watanabe
b085cd3786
network: generate addresses from pool with larger prefixlen
2019-03-01 16:34:55 +09:00
Yu Watanabe
304e7e9d53
network: generate random prefix from address pool
...
Fixes #9955 .
2019-03-01 16:34:44 +09:00
Yu Watanabe
7e43ebfbf9
network: propagate error from in_addr_is_null()
2019-03-01 15:55:55 +09:00
Yu Watanabe
c9207ff3a4
network: check prefixlen when null address is specified to Address=
2019-03-01 15:52:12 +09:00
Yu Watanabe
f2efbeafb8
network: use fd00::/8 for ipv6 address pool
...
fc00::/8 may be used in the future. See rfc4193.
2019-03-01 15:52:12 +09:00
Yu Watanabe
198afaab90
network: make address_pool_new() static
2019-03-01 15:52:12 +09:00
Yu Watanabe
2850cd40ee
network: wrap long lines
2019-02-28 10:57:20 +09:00
Yu Watanabe
33680b0a26
network: simplify config_parse_lifetime()
2019-02-28 10:56:33 +09:00
Yu Watanabe
4aa4c4b0f4
network: avoid address section freed
...
Otherwise, if HomeAddress= or friends are specified at the first line of
a section, then its assignment will be ignored.
2019-02-28 10:54:20 +09:00
Yu Watanabe
f205a92a5c
network: cleanup logging in route related config parsers
2019-02-28 10:39:14 +09:00
Yu Watanabe
01d4e7323c
network: do not override previously specified family
2019-02-28 10:37:58 +09:00
Yu Watanabe
4912ab7774
network: enable GatewayOnLink= if Gateway= without static address configured
...
And warn about that.
But this only done if GatewayOnLink= is not specified. When it is
explicitly disabled, then the flag will not be set.
2019-02-28 10:34:21 +09:00
Yu Watanabe
54901fd222
network: save GatewayOnLink= value as tristate in Route
...
This should not change any behavior. But used in the later commit.
2019-02-28 10:16:55 +09:00
Yu Watanabe
4bec2f237b
network: relax the .network file check
...
Previously, if a .networ file contains invalid [Address] or [Route]
section, then the file is completely dropped. This makes networkd
just drops invalid sections.
2019-02-28 10:01:56 +09:00
Yu Watanabe
9cb8c55934
network: rename GatewayOnlink= to GatewayOnLink=
...
But still GatewayOnlink= is supported for backward compatibility.
2019-02-28 10:00:22 +09:00
Lennart Poettering
dc16327c48
Merge pull request #11795 from yuwata/fix-network-routing-policy-11280
...
network: fix routing policy rule issue #11280
2019-02-27 18:43:56 +01:00
Lennart Poettering
200fb167a2
Merge pull request #11844 from keszybz/networkd-fuzzer-fixes
...
Networkd fuzzer fixes
2019-02-27 17:45:55 +01:00
Zbigniew Jędrzejewski-Szmek
4b151b7132
Merge pull request #11807 from yuwata/test-vlan-mtu
...
network: increase MTU if VLAN= or MACVLAN= requests higher value
2019-02-27 17:15:29 +01:00
Zbigniew Jędrzejewski-Szmek
c448459d56
networkd: refuse more than 128 NTP servers
...
This test case is a bit silly, but it shows that our code is unprepared to
handle so many network servers, with quadratic complexity in various places.
I don't think there are any valid reasons to have hundres of NTP servers
configured, so let's just emit a warning and cut the list short.
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13354
2019-02-27 14:52:33 +01:00