Yu Watanabe
87adeabfb7
test-network: update tests for issue #16784
2020-09-10 18:57:07 +09:00
Yu Watanabe
17d2b2e4ef
network: replace FRA_IFNAME -> FRA_IIFNAME
...
No functional change, as FRA_IFNAME is an alias of FRA_IIFNAME.
2020-09-10 18:57:07 +09:00
Yu Watanabe
2102d33cfb
network: also process RTM_NEWRULE or RTM_DELRULE message which does not contain src and dst addresses
...
Fixes #16784 .
2020-09-10 18:57:07 +09:00
Yu Watanabe
bd1000b4a0
network: fix the default mask for FirewallMark=
...
And always send FRA_FWMASK if FirewallMark= is set.
C.f. https://github.com/torvalds/linux/commit/b8964ed9fa727109c9084abc807652ebfb681c18
Partially fixes #16784 .
2020-09-10 18:56:18 +09:00
Yu Watanabe
c2d6fcb147
network: do not assign return value if the parse_fwmark_fwmask() fails
...
This also removes redundant logs, and makes input string not copied if
it does not contain '/'.
2020-09-10 18:19:03 +09:00
Yu Watanabe
d85b0d69f1
network: add debug log for removing routing policy rules
2020-09-10 18:19:03 +09:00
Yu Watanabe
755dbda355
network: also logs priority of routing policy rules
2020-09-10 18:18:59 +09:00
Yu Watanabe
b6c7c4a87b
network: update log message for rtnl messages
2020-09-10 18:14:24 +09:00
Yu Watanabe
e77f52e5f9
udev: warn if failed to set buffer size for device monitor
2020-09-09 06:46:54 +09:00
Yu Watanabe
a725efb08b
network: increase receive buffer size for device monitor
...
If networkd creates huge amount of netdevs, then the buffer of device
monitor becomes easily flowed.
Hopefully fixes #16865 .
2020-09-09 06:39:05 +09:00
Yu Watanabe
d31f33e3c9
network: do not start device monitor if /sys is read-only
...
Follow-up for bf331d8717 .
2020-09-09 06:39:05 +09:00
Yu Watanabe
e13af7bdb6
network: honor the buffer size specified in networkd.socket
2020-09-09 06:39:05 +09:00
Yu Watanabe
ded71ab3bc
core/socket: use fd_set_{rcv,snd}buf()
2020-09-09 06:39:05 +09:00
Yu Watanabe
2807a79424
sd-device-monitor: use fd_set_rcvbuf()
2020-09-09 06:39:05 +09:00
Yu Watanabe
d9d9b2a0ae
util: introduce fd_set_{snd,rcv}buf()
2020-09-09 06:39:05 +09:00
Yu Watanabe
b92f350789
util: try to set with SO_{RCV,SND}BUFFORCE when requested size is larger than the kernel limit
...
The commit 10ce2e0681 inverts the order of
SO_{RCV,SND}BUFFORCE and SO_{RCV,SND}BUF. However, setting buffer size with
SO_{RCV,SND}BUF does not fail even if the requested size is larger than
the kernel limit. Hence, SO_{RCV,SND}BUFFORCE will not use anymore and
the buffer size is always limited by the kernel limit even if we have
the priviledge to ignore the limit.
This makes the buffer size is checked after configuring it with
SO_{RCV,SND}BUF, and if it is still not sufficient, then try to set it
with FORCE command. With this commit, if we have enough priviledge, the
requested buffer size is correctly set.
Hopefully fixes #14417 .
2020-09-09 06:39:05 +09:00
Yu Watanabe
1263c85ef3
util: refuse to set too large value for socket buffer size
2020-09-09 06:39:05 +09:00
Yu Watanabe
8c63924c8d
network: ignore error on increasing netlink receive buffer size
2020-09-09 06:39:05 +09:00
Yu Watanabe
d157714b68
network: make log_link_error() or friends return void
2020-09-09 02:34:38 +09:00
Yu Watanabe
8ed6f81ba3
core: make log_unit_error() or friends return void
2020-09-09 02:34:38 +09:00
Yu Watanabe
93c5b90459
core/slice: explicitly specify return value
2020-09-09 02:34:38 +09:00
Yu Watanabe
38104ee2a5
udev: do not discard const qualifier
2020-09-09 02:34:38 +09:00
Yu Watanabe
ab54f12b78
sd-device: make log_device_error() or friends return void
2020-09-09 02:34:38 +09:00
Yu Watanabe
09c69ecaeb
udev: explicitly specify return value
2020-09-09 02:34:38 +09:00
Yu Watanabe
a718b951ac
udev: return negative errno for invalid EVDEV_ABS_XXX= property
2020-09-09 02:34:38 +09:00
Yu Watanabe
3b4e123173
udev: make log_rule_error() or friends return void
2020-09-09 02:34:38 +09:00
Yu Watanabe
68248f43fc
test-network: add test for IPv6Token=prefixstable
2020-09-08 14:32:44 +09:00
Yu Watanabe
b27caa34f6
network: make prefixstable mode of IPv6Token= can be applied to any received prefixes
...
Closes #4625 .
2020-09-08 14:32:33 +09:00
Yu Watanabe
50550722e3
network: fix NDisc handling for the case when multiple routers exist
...
69203fba70 does not consider the case that
multiple routers exist, and causes #16719 .
Fixes #16719 .
2020-09-08 02:30:04 +09:00
Yu Watanabe
501b09dbf2
network: expose route_{hash,compare}_func()
2020-09-08 02:30:04 +09:00
Yu Watanabe
99a2878457
network: expose address_{hash,compare}_func()
2020-09-08 02:30:04 +09:00
Yu Watanabe
badd49288d
util: expose in6_addr_{hash,compare}_func()
2020-09-08 02:30:04 +09:00
Yu Watanabe
f3f14c573b
util: constify the second argument of set_get()
2020-09-04 17:52:26 +02:00
Yu Watanabe
89f7435d0c
resolve: use correct fd for UDP stub listner
2020-09-04 23:54:35 +09:00
Yu Watanabe
d1fb8cdae2
resolve: do not check sender and destination for packet received by extra DNS stub listner
2020-09-04 23:54:35 +09:00
Yu Watanabe
7216a3b5dc
resolve: use sd_event_source_set_io_fd_own() for stub listners
2020-09-04 23:54:35 +09:00
Yu Watanabe
bf22f231cf
resolve: introduce dns_stub_listener_extra_free() and set it as a key destructor
2020-09-04 23:54:35 +09:00
Yu Watanabe
1c17bcb3ad
resolve: adjust error messages
2020-09-04 23:54:35 +09:00
Yu Watanabe
af8b138422
resolve: do not set IPv4 specific options on IPv6 socket
2020-09-04 23:54:30 +09:00
Yu Watanabe
d40f00d798
resolve: do not set IP_TTL for extra DNS stub listeners
2020-09-04 23:53:22 +09:00
Yu Watanabe
180c22328b
missing: add IPV6_FREEBIND
2020-09-04 23:53:18 +09:00
Yu Watanabe
fc7676e313
util: drop unused socket_addr_port_from_string_auto()
2020-09-04 20:05:58 +09:00
Yu Watanabe
ca8b62b522
resolve: use in_addr_union to store addresses for extra dns stub listeners
2020-09-04 20:05:58 +09:00
Yu Watanabe
b4b7ea1b32
resolve: fix indentation
2020-09-04 20:05:58 +09:00
Yu Watanabe
4e0a46f65e
util: introduce SOCKADDR_LEN() macro
2020-09-04 20:05:58 +09:00
Yu Watanabe
fc6021554b
test: add tests for in_addr_port_from_string_auto()
2020-09-04 20:05:58 +09:00
Yu Watanabe
23c5aeaac3
test: move several tests from test-socket-util.c
2020-09-04 20:05:58 +09:00
Yu Watanabe
c4fe658366
util: introduce in_addr_port_to_string()
2020-09-04 20:05:58 +09:00
Yu Watanabe
c364cefb3a
util: make in_addr_ifindex_to_string() an alias of in_addr_port_ifindex_name_to_string()
2020-09-04 20:05:58 +09:00
Yu Watanabe
355e884ded
util: introduce in_addr_port_from_string_auto()
2020-09-04 20:05:58 +09:00
Yu Watanabe
4650582657
resolve: stop extra stub listners before freeing information about them
2020-09-04 20:05:58 +09:00
Yu Watanabe
7314b39746
resolve: set DNS_STUB_LISTENER_YES if no protocol is specified in DNSStubListenExtra=
2020-09-04 20:05:58 +09:00
Yu Watanabe
dce65cd40f
resolve: Manager::dns_stub_listener_mode is not relevant to extra stub listeners
2020-09-04 20:05:58 +09:00
Yu Watanabe
88d2cb7c0e
resolve: make DnsStubListenerMode bitfield
2020-09-04 20:05:58 +09:00
Yu Watanabe
8ae07803a0
resolve: rename dns_stub_extra_event_source -> event_source
...
As the name is too redundant.
2020-09-04 20:05:58 +09:00
Yu Watanabe
6421194b31
man: update DNSStubListenerExtra=
2020-09-04 20:05:54 +09:00
Yu Watanabe
aea4660af8
test: add tests for sd_bus_error_set_errnof()
2020-09-04 19:15:50 +09:00
Yu Watanabe
caf4ba83d5
sd-bus: use _cleanup_free_ macro in sd_bus_error_set_errnofv()
...
No functional change.
2020-09-04 19:15:45 +09:00
Yu Watanabe
2200c3cf56
network: fixes gateway assignment through DHCPv4
...
This fixes the following issue:
- If a DHCP lease does not contains router option, then routes with
`Gateway=_dhcp` setting introduce unexpected results.
This also makes several failure paths critical. And adjust warnings when
classless routes are provided.
2020-09-04 11:12:03 +02:00
Yu Watanabe
3605aae161
bash-completion: resolvectl: support 'log-level' command
2020-09-04 17:03:28 +09:00
Yu Watanabe
bde4bc9bd2
resolvectl: add 'log-level' to help message
...
Follow-up for df9578498f .
2020-09-04 16:58:36 +09:00
Yu Watanabe
ed89e54a49
man: mention that 'networkctl reconfigure' does not reload configs
2020-09-04 09:05:45 +09:00
Yu Watanabe
c45fdad66d
network: configure DHCP routes after DHCP address is ready
2020-09-04 09:05:45 +09:00
Yu Watanabe
687b3bc6f4
network: dhcp4: reset counter only when the lease address is new
2020-09-04 09:05:45 +09:00
Yu Watanabe
4dd6a3aad5
sd-ipv4acd: introduce sd_ipv4acd_get_address()
2020-09-04 09:05:45 +09:00
Yu Watanabe
5acf54a063
network: dhcp4: stop IPv4ACD before assigning new address
2020-09-04 09:05:34 +09:00
Yu Watanabe
6a776e3a18
sd-ipv4acd: do not call callback in sd_ipv4acd_stop() when it is already stopped
2020-09-04 09:04:43 +09:00
Yu Watanabe
dce1cd4188
network: voidify return value of sd_ipv4acd_stop()
2020-09-04 09:04:43 +09:00
Yu Watanabe
5c72a6d5d3
network: logs about unknown key
2020-09-04 08:48:08 +09:00
Yu Watanabe
f405179d65
network: honor already specified family when parsing from= or to= in serialized rule
2020-09-04 08:48:08 +09:00
Yu Watanabe
9d6282d120
network: do not reallocate buffer
2020-09-04 08:48:04 +09:00
Yu Watanabe
d0ac05613b
network: serialize InvertRule= in [RoutingPolicyRule]
2020-09-04 08:47:22 +09:00
Yu Watanabe
1680b11df4
network: add whitespace after family= and priority= in serialized routing policy rule
...
This also makes priority= serialized only when its value is non-zero.
2020-09-04 08:44:19 +09:00
Yu Watanabe
3c94b20dd3
network: downgrade error level when the error is ignored
2020-09-04 08:44:14 +09:00
Yu Watanabe
7e60a37d04
network: move routing_policy_rule_read_full_file()
2020-09-04 08:42:01 +09:00
Yu Watanabe
876dc2b014
network: dhcp6: logs only new address
...
Closes #16731 .
2020-08-27 21:24:07 +02:00
Yu Watanabe
89d36ce8f7
journal: fix divide-by-zero warning
...
Fixes CID#1430209.
2020-08-27 18:20:34 +09:00
Yu Watanabe
8062e643e6
core: clear bind mounts on error
...
Follow-up for bbb4e7f39f .
Fixes CID#1431998.
2020-08-27 18:20:34 +09:00
Yu Watanabe
f2c676c6c0
man: clarify that several networkctl commands takes device names
2020-08-27 16:35:25 +09:00
Yu Watanabe
df696b1413
networkctl: label command does not take any argument
2020-08-27 16:32:13 +09:00
Yu Watanabe
d91b9bbce8
man: fix invalid tag place
2020-08-21 15:30:05 +09:00
Yu Watanabe
9dffe6fc27
test-network: add a test case for reconfiguring routing policy rules
...
C.f. #16784 .
2020-08-21 15:27:38 +09:00
Yu Watanabe
46b875fb80
network: do not fail if UseMTU=yes on DHCP lease lost
...
This fixes a bug introduced by 6906794dd1 .
Fixes #16768 .
2020-08-18 20:33:58 +02:00
Yu Watanabe
9b966cee43
network: wait for previous address removal before configuring static addresses
...
Fixes #16696 .
2020-08-08 12:41:03 +09:00
Yu Watanabe
b6766fb114
network: drop unnecessary bracket
2020-08-08 12:31:59 +09:00
Yu Watanabe
fb282d4e25
network: only process non-error message
2020-08-08 12:31:12 +09:00
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