summaryrefslogtreecommitdiff
path: root/src/network/networkd-ipv4acd.c
Commit message (Collapse)AuthorAgeFilesLines
* networkd-ipv4acd.c: Use net/if.h for getting IFF_LOOPBACK definitionKhem Raj2022-11-091-1/+2
| | | | | | | This helps in avoiding compiling errors on musl. Definition of IFF_LOOPBACK is the reason for including linux/if_arp.h, this however could be obtained from net/if.h glibc header equally and makes it portable as well.
* tree-wide: use ASSERT_PTR moreDavid Tardon2022-09-131-4/+2
|
* network: unref existing sd_ipv4acd object when not necessaryYu Watanabe2022-08-181-10/+24
| | | | | | On reconfiguring an interface, the new setting may not enable IPv4ACD for an existing address anymore. Hence, we need to unref it. Otherwise, newly requested addresses may never be ready for (re-)configuring.
* network: fix DHCPv4 address renewal with IPv4ACDYu Watanabe2022-08-181-27/+35
| | | | | | | | | | Previously, when a DHCP address is renewed and if the IPv4ACD for the address is enabled, the address will never drop the probing flag, thus the lifetime of the address will never be updated. This drops NETWORK_CONFIG_STATE_PROBING, and the IPv4ACD status is managed another bit, Address.acd_bound. And, the flag is updated only when the IPv4ACD announced the address or detects conflict.
* network: do not try to start ipv4acd on non-supported interfacesYu Watanabe2022-08-021-1/+1
| | | | Fixes IPv4LL issue reported in #23197.
* network: split link_ipv4ll_enabled() into twoYu Watanabe2022-08-021-0/+30
| | | | And move it from networkd-link.[ch] to relevant files.
* network: currently IPv4ACD requires MAC address whose length is ETH_ALENYu Watanabe2022-01-311-3/+5
|
* network: use NetworkConfigSource/State to manage addresses and routesYu Watanabe2021-09-241-94/+63
| | | | This also fixes #20146.
* network: introduce ipv4acd_set_ifname()Yu Watanabe2021-09-101-0/+15
|
* Drop the text argument from assert_not_reached()Zbigniew Jędrzejewski-Szmek2021-08-031-1/+1
| | | | | | | | | | | | | | | | | In general we almost never hit those asserts in production code, so users see them very rarely, if ever. But either way, we just need something that users can pass to the developers. We have quite a few of those asserts, and some have fairly nice messages, but many are like "WTF?" or "???" or "unexpected something". The error that is printed includes the file location, and function name. In almost all functions there's at most one assert, so the function name alone is enough to identify the failure for a developer. So we don't get much extra from the message, and we might just as well drop them. Dropping them makes our code a tiny bit smaller, and most importantly, improves development experience by making it easy to insert such an assert in the code without thinking how to phrase the argument.
* network: ipv4acd: update log messageYu Watanabe2021-07-011-3/+3
| | | | C.f. https://github.com/systemd/systemd/pull/19980#discussion_r661784168
* network: introduce callback fucntions to check the sender MAC address for ↵Yu Watanabe2021-07-011-0/+19
| | | | | | IPv4ACD and IPv4LL Fixes #12145.
* network: ipv4acd: first probe address and then assign itYu Watanabe2021-07-011-0/+271
Previously, if IPv4 ACD is enabled on an address, then we first assign the address, and start sd-ipv4acd daemon for the address. This is not only RFC incompliant, but also the address is always dropped, as the daemon always considers the address is conflicted. This commit makes networkd first starts sd-ipv4acd daemon to probe the address, and then the address is configured if no conflict is detected. Fixes #17235.