Frantisek Sumsal
d46b79bbe0
tree-wide: drop if braces around single line expressions as well
2020-10-09 15:11:55 +02:00
Frantisek Sumsal
d7a0f1f4f9
tree-wide: assorted coccinelle fixes
2020-10-09 15:02:23 +02:00
Zbigniew Jędrzejewski-Szmek
081b300976
networkd: add assert to appease coverity
...
The code was OK, but not obviously so. Let's add an assert to help a
human or nonhuman reader figure it out.
Coverity CID#1433224.
2020-10-09 08:14:54 +02:00
Yu Watanabe
ceea6c1aff
network: introduce IPV4_ADDRESS_FMT_STR macro
...
This also moves ADDRESS_FMT_VAL() macro to networkd-address.h, and
renames it to IPV4_ADDRESS_FMT_VAL().
2020-10-08 02:51:23 +09:00
Yu Watanabe
d442bb3728
network: make Gateway= in [Route] section accept an empty string
2020-10-08 02:51:23 +09:00
Yu Watanabe
d306d1d0ca
network: introduce Gateway=_dhcp4 and _dhcp6, and deprecate "_dhcp"
...
Fixes #17249 .
2020-10-08 02:51:23 +09:00
Yu Watanabe
f9bb333832
network: manage multipath routes separately
2020-10-08 02:51:23 +09:00
Yu Watanabe
2fe1d557e5
sd-netlink: introduce rtattr_read_nexthop()
2020-10-08 02:51:23 +09:00
Yu Watanabe
d6ad41e27d
network: free Route object when route_remove() fails
...
When route_remove() succeeds, the Route object will be freed later by
manager_rtnl_process_route().
2020-10-08 02:51:23 +09:00
Yu Watanabe
423c249c2e
network: constify arguments
2020-10-08 02:51:23 +09:00
Yu Watanabe
6dd5398137
network: support IPv4 route with IPv6 gateway
2020-10-08 00:06:19 +09:00
Yu Watanabe
ad208fac73
network: also manage routes without RTA_OIF attribute
2020-10-07 15:22:10 +02:00
Yu Watanabe
fd7701bf31
network: ignore Scope= for IPv6 routes as it will not be used
2020-10-07 15:22:10 +02:00
Yu Watanabe
8973df5c42
network: set default priority for IPv6 routes
...
See inet6_rtm_newroute() in kernel's net/ipv6/route.c.
2020-10-07 15:22:09 +02:00
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
2ffd6d73f9
network: check feature is enabled in xxx_configure()
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
acc9fc2f51
network: drop unused function
2020-10-07 02:50:51 +09:00
Yu Watanabe
5e0534f1c1
network: move sysctl related functions to networkd-sysctl.c
2020-10-07 02:50:51 +09:00
Yu Watanabe
be9363ccab
network: introduce radv_update_mac()
2020-10-07 02:50:51 +09:00
Yu Watanabe
eebba6dc24
network: introduce dhcp6_update_mac()
2020-10-07 02:50:51 +09:00
Yu Watanabe
d947f7f977
network: introduce dhcp4_update_mac()
2020-10-07 02:50:50 +09:00
Yu Watanabe
a3adb4a6a2
network: introduce ipv4ll_update_mac()
2020-10-07 02:50:50 +09:00
Yu Watanabe
5460bde5c5
network: introduce link_serialize_dhcp6_client()
2020-10-07 02:50:50 +09:00
Yu Watanabe
ca21a19a2e
network: introduce link_serialize_ipv4ll()
2020-10-07 02:50:50 +09:00
Yu Watanabe
daad60d19e
network: introduce link_deserialize_ipv4ll()
2020-10-07 02:50:50 +09:00
Yu Watanabe
571eeba909
network: introduce link_deserialize_dhcp4()
2020-10-07 02:50:50 +09:00
Yu Watanabe
bbe694f91f
network: introduce network_verify_sr_iov()
2020-10-07 02:50:50 +09:00
Yu Watanabe
f3a3ff2762
network: move link_configure_sr_iov()
2020-10-07 02:50:50 +09:00
Yu Watanabe
209af9a67a
network: introduce network_verify_traffic_control()
2020-10-07 02:50:50 +09:00
Yu Watanabe
200543791a
network: move link_configure_traffic_control()
2020-10-07 02:50:50 +09:00
Yu Watanabe
34d7f2c99e
network: merge link_set_bridge_vlan() and br_vlan_configure()
2020-10-07 02:50:50 +09:00
Yu Watanabe
256c75fd1f
network: move DUID related functions
2020-10-07 02:50:50 +09:00
Yu Watanabe
086b8853d1
network: move link_radv_enabled()
2020-10-07 02:50:50 +09:00
Yu Watanabe
5ae0fb7fb7
network: move link_dhcp4_server_enabled()
2020-10-07 02:50:50 +09:00
Yu Watanabe
062c020fb6
network: move link_ipv6_accept_ra_enabled()
2020-10-07 02:50:50 +09:00
Yu Watanabe
6f7a17ff0c
network: unify link_ipv{4,6}_forward_enabled()
2020-10-07 02:50:50 +09:00
Yu Watanabe
67c311abd3
network: unify link_dhcp{4,6}_enabled()
2020-10-07 02:50:50 +09:00
Yu Watanabe
ac49887e8c
network: move link_get_xxx_route_table()
2020-10-07 02:50:50 +09:00
Yu Watanabe
bfbf150ee6
network: manage address pools by OrderedSet
2020-10-07 02:50:50 +09:00
Yu Watanabe
3fe721c674
network: drop unused argument
2020-10-07 02:50:50 +09:00