summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-ndisc.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* network: keep dynamic configurations as possible as we can on reconfigureYu Watanabe2024-11-051-0/+1
| | | | | | | | | | E.g. when a .network file is updated, but DHCP setting is unchanged, it is not necessary to drop acquired DHCP lease. So, let's not stop DHCP client and friends in link_reconfigure_impl(), but stop them later when we know they are not necessary anymore. Still DHCP clients and friends are stopped and leases are dropped when the explicit reconfiguration is requested
* ndisc: Parse RFC9463 encrypted DNS (DNR) optionRonan Pigott2024-10-211-0/+7
| | | | This option is equivalent to the V4/V6 DNR options for DHCP.
* network: rename DHCPUseDomains -> UseDomainsYu Watanabe2024-04-191-1/+0
| | | | As it is also used for NDisc.
* network/address-generation: regenerate IPv6 prefix stable address on conflictYu Watanabe2024-04-091-0/+2
| | | | | | | | | | If a generated address with IPv6Token=prefixstable conflicts with the one on another node or interface, let's generate another address and try to assign it. This improves support of RFC 7217. Fixes #31605.
* network/ndisc: rename Network.ipv6_accept_ra -> Network.ndiscYu Watanabe2024-02-261-4/+4
| | | | | These settings are leated to sd-ndisc and Neighbor Discovery protocol. Let's use more suitable name.
* network: ndisc - Allow to parse PREF64 prefixSusant Sahani2023-09-041-0/+9
|
* network: handle captive portal with multiple routersYu Watanabe2023-07-061-0/+8
| | | | | | | | | | Before this patch, if a network has multiple routers and one of them provides a captive portal, then the portal was overwritten or cleared when another RA from another router is received. This makes captive portals managed in the similar way as DNS servers or DNS domains. So now captive portal can safely handled even if a network has multiple routers.
* network: update commentYu Watanabe2023-07-061-2/+2
|
* network: drop unnecessary call of ndisc_vacuum()Yu Watanabe2022-10-071-1/+0
| | | | | | | | | | | | After the commit 773024685b37170395a11716f8e4ad99d3580455, DNS servers or domains are dropped when their lifefime become zero. Hence, it is not necessary to try to them when writing state file. Of course, because of the accuracy of the timer event source or priority of event sources, a possibility is introduced that a DNS server or domain with zero lifetime is stored in the state file. However, such entry will be dropped soon when the timer event source is triggered. Hence, that should not cause any real issues.
* network: ndisc: also introduce timer event source to drop outdated settingsYu Watanabe2022-10-031-0/+1
| | | | | Otherwise, settings based on previously received RA messages will never removed without receiving a new RA message.
* network: don't forget old RAs when a new one arrivesThomas Hebb2022-10-031-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IPv6 Neighbor Discovery lets us autoconfigure a link's IPv6 addresses, routes, DNS servers, and DNS search domains by listening for Router Advertisement (RA) packets broadcast by one or more routers on the link. Each RA can contain zero or more "options," each describing one piece of configuration (e.g. a single route). Currently, when we receive an RA from a router, we delete any addresses, routes, etc. that originated from that router's previous RAs unless they're also present as options in the new RA. That behavior is a violation of RFC 4861[1]. In Section 9, the RFC states that Senders MAY send a subset of options in different packets. ... Thus, a receiver MUST NOT associate any action with the absence of an option in a particular packet. This protocol specifies that receivers should only act on the expiration of timers and on the information that is received in the packets. Several other passages in the RFC reiterate this. Section 6.2.3: A router MAY choose not to include some or all options when sending unsolicited Router Advertisements. Section 6.3.4: Hosts accept the union of all received information; the receipt of a Router Advertisement MUST NOT invalidate all information received in a previous advertisement or from another source. At least one consumer router in production today, the Google Nest Wifi, often sends RAs that omit its global IPv6 prefix. When current versions of systemd-networkd receive those RAs, they immediately delete the interface's global IPv6 address, which breaks IPv6 connectivity. Fix the issue by removing the invalidation logic entirely. It's not needed at all, since we already invalidate addresses, routes, and DNS configuration when the interface goes down or their lifetimes expire. This fix does have the side effect of preventing changes to the .network file (e.g. denylisted prefixes, whether to add routes from RAs) from taking effect as soon as a new RA arrives. Instead, a full interface reconfiguration is needed. But triggering those changes on RA receipt was already rather arbitrary and out of the administrator's control, so I think this change is fine. commit 69203fba700e ("network: ndisc: remove old addresses and routes after at least one SLAAC address becomes ready") introduced this behavior. commit 50550722e3ba fixed it partially, by preventing one router's RAs from invalidating another router's configuration. [1] https://www.rfc-editor.org/rfc/rfc4861 Fixes: 69203fba700e ("network: ndisc: remove old addresses and routes after at least one SLAAC address becomes ready")
* network: re-design request queueYu Watanabe2022-03-111-2/+0
| | | | | | | | This makes Request object takes hash, compare, free, and process functions. With this change, the logic in networkd-queue.c can be mostly independent of the type of the request or the object (e.g. Address) assigned to the request, and it becomes simpler.
* network: make request_process_address() and friends take Link and ↵Yu Watanabe2022-03-111-1/+1
| | | | | | | | | | | | | | | | | corresponding object This also renames e.g. request_process_address() -> address_process_request(). Also, this drops type checks such as `assert(req->type == REQUEST_TYPE_ADDRESS)`, as in the later commits, the function of processing request, e.g. `address_process_request()`, will be assigned to the Request object when it is created. And the request type will be used to distinguish and to avoid deduplicating requests which do not have any assigned objects, like REQUEST_TYPE_DHCP4_CLIENT. Hence, the type checks in process functions are mostly not necessary and redundant. This is mostly cleanups and preparation for later commits, and should not change any behavior.
* network: configure NDisc after MAC address is assignedYu Watanabe2022-01-311-1/+4
|
* network: ndisc: rename valid_until -> lifetime_usecYu Watanabe2021-10-211-2/+6
|
* network: move address generation methods to network-address-generation.[ch]Yu Watanabe2021-10-061-1/+0
|
* network: use NetworkConfigSource/State to manage addresses and routesYu Watanabe2021-09-241-20/+3
| | | | This also fixes #20146.
* network: dhcp4,ndisc: make addresses in Allow/DenyList= optionally take ↵Yu Watanabe2021-08-231-1/+0
| | | | | | prefix length Closes #20505.
* network: make IPv6Token private, and ipv6token_new() staticYu Watanabe2021-08-101-19/+0
|
* network: configure non-dhcp configs earlier even DUID-UUID is used by DHCP ↵Yu Watanabe2021-04-211-0/+1
| | | | | | | | | | clients Previously, if DUID-UUID is used, all configurations are configured after networkd gets product uuid of machine. This makes only DHCP clients are delayed, and other configs are configured earlier.
* network: also introduce UseDomains= for [DHCPv6] sectionYu Watanabe2021-03-131-0/+1
| | | | | When we split [DHCP] section into [DHCPv4] and [DHCPv6], UseDomains= setting was forgot to be introduced in [DHCPv6] section.
* networkd-ndisc: drop confused freepp functionZbigniew Jędrzejewski-Szmek2021-02-161-1/+0
| | | | | | | | | The function to cleanup IPv6Token was defined using freep, i.e. the macro generated a freepp function. The correct way would be to do something like #define ipv6_token_free mfree DEFINE_TRIVIAL_CLEANUP_FUNC(IPv6Token *, ipv6_token_free); which would create ipv6_token_freep(). But since the cleanup function is unused, let's just drop it.
* tree-wide: use -EINVAL for enum invalid valuesZbigniew Jędrzejewski-Szmek2021-02-101-2/+2
| | | | | | | | | As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617. This does not touch anything exposed in src/systemd. Changing the defines there would be a compatibility break. Note that tests are broken after this commit. They will be fixed in the next one.
* networkd: add support for prefix allow-list and route allow-listSusant Sahani2020-12-241-1/+1
|
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* network: introduce network_adjust_ipv6_accept_ra()Yu Watanabe2020-10-151-0/+2
|
* network: move link_ipv6_accept_ra_enabled()Yu Watanabe2020-10-061-0/+2
|
* network: fix NDisc handling for the case when multiple routers existYu Watanabe2020-09-071-0/+18
| | | | | | | 69203fba700ea8d7b0c4f4e3d1e1f809ac4644a1 does not consider the case that multiple routers exist, and causes #16719. Fixes #16719.
* network: ndisc: also remove old DNSSL or RDNSS records after an SLAAC ↵Yu Watanabe2020-07-281-0/+4
| | | | address is ready
* tree-wide: avoid some loaded termsLennart Poettering2020-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | https://tools.ietf.org/html/draft-knodel-terminology-02 https://lwn.net/Articles/823224/ This gets rid of most but not occasions of these loaded terms: 1. scsi_id and friends are something that is supposed to be removed from our tree (see #7594) 2. The test suite defines an API used by the ubuntu CI. We can remove this too later, but this needs to be done in sync with the ubuntu CI. 3. In some cases the terms are part of APIs we call or where we expose concepts the kernel names the way it names them. (In particular all remaining uses of the word "slave" in our codebase are like this, it's used by the POSIX PTY layer, by the network subsystem, the mount API and the block device subsystem). Getting rid of the term in these contexts would mean doing some major fixes of the kernel ABI first. Regarding the replacements: when whitelist/blacklist is used as noun we replace with with allow list/deny list, and when used as verb with allow-list/deny-list.
* network: Allow DHCPv6 client to be started even if no O or M bit in RA.Susant Sahani2020-04-161-0/+12
|
* network: rename eui64 to staticYu Watanabe2020-02-071-1/+1
| | | | | | See RFC 4291. Follow-up for 5f506a55606fed9fd74b851a18f15a9835a26d08.
* network: Allow to specify multiple IPv6Token for SLAACSusant Sahani2020-02-051-0/+21
| | | | | | | | | | | | | | | | Provide names to choose between different auto-generation types: 2.1 "eui64" for EUI-64 of RFC 4291 2.2 "prefixstable" for RFC 7217 ``` [Match] Name=veth99 [Network] DHCP=no IPv6AcceptRA=yes IPv6Token=prefixstable:2001:888:0db8:1:: ```
* networkd: Ability to selectively ignore IPv6 prefixes supplied via router ↵Susant Sahani2019-05-191-0/+3
| | | | | | advertisement Closes https://github.com/systemd/systemd/issues/10647
* headers: remove unneeded includes from util.hZbigniew Jędrzejewski-Szmek2019-03-271-0/+1
| | | | | This means we need to include many more headers in various files that simply included util.h before, but it seems cleaner to do it this way.
* tree-wide: drop double newlineYu Watanabe2018-06-291-1/+0
|
* tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek2018-06-201-3/+0
| | | | | | | | Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-1/+1
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* networkd: flush DNSSL/RDNSS lists when we lose carrierLennart Poettering2016-11-021-0/+1
| | | | Fixes: #3870
* network: beef up ipv6 RA support considerablyLennart Poettering2016-06-061-0/+39
This reworks sd-ndisc and networkd substantially to support IPv6 RA much more comprehensively. Since the API is extended quite a bit networkd has been ported over too, and the patch is not as straight-forward as one could wish. The rework includes: - Support for DNSSL, RDNSS and RA routing options in sd-ndisc and networkd. Two new configuration options have been added to networkd to make this configurable. - sd-ndisc now exposes an sd_ndisc_router object that encapsulates a full RA message, and has direct, friendly acessor functions for the singleton RA properties, as well as an iterative interface to iterate through known and unsupported options. The router object may either be retrieved from the wire, or generated from raw data. In many ways the sd-ndisc API now matches the sd-lldp API, except that no implicit database of seen data is kept. (Note that sd-ndisc actually had a half-written, but unused implementaiton of such a store, which is removed now.) - sd-ndisc will now collect the reception timestamps of RA, which is useful to make sd_ndisc_router fully descriptive of what it covers. Fixes: #1079