summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-link.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* network: rename KeepConfiguration=dhcp -> dynamicYu Watanabe2024-11-141-1/+1
| | | | | KeepConfiguration=dhcp keeps not only DHCP configurations but also SLAAC or IPV4LL. Let's rename the value to 'dynamic'.
* network: drop unnecessary size specifierYu Watanabe2024-11-111-1/+1
| | | | It does not save any memory usage but increase code complexity.
* network: introduce LINK_RECONFIGURE_CLEANLY flagYu Watanabe2024-11-051-0/+1
| | | | | | And use it when explicit reconfiguration is requested by Reconfigure() DBus method or networkd certainly detects that connected network is changed. Otherwise do not use the flag especially when we come back from sleep mode.
* network: several cleanups for link_reconfigure()Yu Watanabe2024-11-051-3/+9
| | | | | | | | | | | | Effectively no functional changes, just refactoring and preparation for later changes. - convert boolean flag 'force' to LinkReconfigurationFlag enum, - merge link_reconfigure() and reconfigure_handler_on_bus_method_reload() as link_reconfigure_full(), - Rename ReconfigureData -> LinkReconfigurationData, - make Reconfigure() DBus message wait for reconfiguration being started before sending reply.
* network: check if interface is initialized after enumeration completedYu Watanabe2024-11-041-0/+2
| | | | | | | | We enumerate interfaces at first, then enumerate other configurations like addresses and so on. If we are running on a container, previously we started to configure the enumerated interfaces before enumerating other configurations. Let's configure interfaces after all configurations are enumerated.
* network: free DHCP client and friends in link_free()Yu Watanabe2024-11-031-1/+0
| | | | | | | | | | | | | No functional change, at least now. Preparation for later commits. But we are planning to extend KeepConfiguration= and also keep addresses and so on assigned by other dynamic configuration protocol like DHCPv6 or NDisc. However, when link_free_engines() is called here, acquired addresses so on by NDisc will be removed, even if link_stop_engines() handles restarting networkd or KeepConfiguration= gracefully. So, let's not free engines here, but free them later in link_free(). It is not necessary to be called here anyway.
* network: update tunnel or vxlan interface if the local address is changedYu Watanabe2024-10-311-0/+3
| | | | | | | If a tunnel or vxlan is configured with Local=dhcp4 or so, then the local address needs to be changed when it is changed. Fixes #24854.
* network: several cleanups for reloading .network files (#34933)Yu Watanabe2024-10-301-2/+2
|\ | | | | split-out of #34909.
| * network: swap asterisk and spaceYu Watanabe2024-10-301-2/+2
| |
* | network: process queued remove requests before networkd is stoppedYu Watanabe2024-10-301-0/+1
|/ | | | | | | | | | | | | | This makes networkd process all queued remove requests when a terminating or restarting signal is received. Otherwise, e.g. DHCPv4 address will not be removed on stop, especially when KeepConfiguration=no. Fixes a bug introduced by 85a6f300c14d75d161cbfdb3eaf5af9594400ecd and its subsequent commits. Fixes #34837. Co-authored-by: Will Fancher <elvishjerricco@gmail.com>
* Merge pull request #30952 from rpigott/resolved-dnrLennart Poettering2024-10-221-0/+1
|\ | | | | RFC9463: Discovery of Network-designated Resolvers
| * ndisc: Parse RFC9463 encrypted DNS (DNR) optionRonan Pigott2024-10-211-0/+1
| | | | | | | | This option is equivalent to the V4/V6 DNR options for DHCP.
* | network: wait for IPv6 MTU being synced to link MTUYu Watanabe2024-10-141-0/+3
|/ | | | | | | | | | | | | The kernel resets the IPv6 MTU of an interface when its link MTU is changed. But it seems the operation is asynchronous, and even when we detect that the link MTU is changed, the IPv6 MTU may not be reset yet. ==== [ 2257.067613] systemd-networkd[447122]: veth99: MTU is changed: 1500 →1600 (min: 68, max: 65535) [ 2257.067641] systemd-networkd[447122]: Setting '/proc/sys/net/ipv6/conf/veth99/mtu' to '1410' [ 2257.067711] systemd-networkd[447122]: No change in value '1410', suppressing write ==== As you can see, even if the link MTU is changed to 1600, the IPv6 MTU is unchanged (in this case, still 1410).
* various: move const ptr indicator to return valueZbigniew Jędrzejewski-Szmek2024-06-191-1/+1
|
* network/ndisc: use router lifetime as one for redirect routeYu Watanabe2024-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | Previously, we did not set lifetime for redirect route, and redirect routes were removed only when received a RA from the target address. Thus, routes that redirect on-link addresses were never removed. RFCs mention nothing about the lifetime of redirection. But the previous implementation does not pass the IPv6 Core Conformance Tests. This makes - remember all received RAs and manage them by the sender address (previously, remembered only one with the highest preference), - then use the router lifetime as one for redirect route, - remove redirect route also when the router corresponds to the sender address is dropped (previously, considered only target address). Note, even if we recieve a new RA, we do not update existing redirect routes. The lifetime of the redirect route is updated only when a new Redirect message is received. Closes #32527.
* network/ndisc: set IPv6 MTU through sysctlYu Watanabe2024-04-101-0/+1
| | | | Closes #31496.
* network/ndisc: add basic support for Redirect messageYu Watanabe2024-04-041-0/+1
| | | | Closes #31438.
* network/ndisc: remember the latest RA from the default routerYu Watanabe2024-04-041-0/+1
| | | | The remembered RA will be used later. Preparation for later commits.
* network/lldp: do not save LLDP neighbors under /run/systemdYu Watanabe2024-03-011-1/+0
| | | | | Now LLDP neighbors are exposed through varlink. Hence, it is not necessary to save to a file.
* network: make Reload bus method synchronousYu Watanabe2024-02-091-0/+1
| | | | | | | | | | | Prompted by https://github.com/systemd/systemd/pull/30085#discussion_r1401534107. Note, like Reconfigure bus method, even reconfiguration for an interface is triggered by Reload method, the method only wait for the link enters configuring state (or unmanaged state if no matching .network file exists). Users still need to invoke systemd-networkd-wait-online if it is necessary to wait for the interface enters configured state after Reload medhod.
* network: adjust default RequiredForOnline= and RequiredFamilyForOnline= settingYu Watanabe2024-02-021-0/+1
| | | | | | | | | E.g. a bonding port does not support addressing, hence the default should be 'enslaved'. Follow-up for 3255bda698d2a02ab2f2825a1e652ac6f0871a89. Closes #27724.
* network/route: manage all routes by Manager objectYu Watanabe2024-01-241-1/+0
| | | | | | | | | | | | | | | | | | Previously, a Route object is owned by a Link object corresponding to the outgoing interface of the route, and a Route object that does not have outgoing interface is owned by the Manager object. However, there were several issues: - if a route has a nexthop ID, then the corresponding nexthop may be changed to use another interface, hence the outgoing interface of the route may be changed. - if a route requested with MultiPathRoute=, then the link who requests the route is different from the outgoing interface of the configured route. So, we need to find routes on other interfaces on reconfiguring or so. By this change, the limit of the number of routes per-interface is tentatively dropped. Let's re-introduce the limit later in a nicer way.
* network: several cleanups for LinkOperationalStateYu Watanabe2024-01-161-0/+2
| | | | | | | - introduce link_required_operstate_for_online() helper function, - use recently introduced macros and helper functions, - unconditionally serialize the minimum and maximum of required operational state.
* network/link: automatically reconfigure interface on failureYu Watanabe2024-01-151-0/+2
| | | | Closes #29246.
* network/nexthop: manage all nexthops by managerYu Watanabe2023-12-141-1/+0
| | | | | | | | | | | | | | The kernel manages nexthops by their IDs. Previously networkd manages nexthops in three ways: - by the corresponding link, if a nexthop has ifindex, - by the manager, if a nexthop does not have ifindex, - by the manager with their IDs. This unifies the three managements of nexthops into one, and use the same way as the kernel uses. This is the one for nexthop already done by aa9626ee3b96e0d2a9a816b5efd38fd7dc829def for neighbor.
* network/brvlan: remove unnecessary bridge vlan IDsYu Watanabe2023-11-121-0/+1
| | | | | | | | | | | | | | | | | | | When an interface is being reconfigured with different bridge vlan settings, this makes old vlan IDs on the interface removed. This also makes the PVID= setting support negative boolean value, e.g. "no", in which case, the currently assigned PVID (typically, assigned by the kernel when an interface is joined to a bridge) is dropped. This feature is requested by #15291. Note, if a .network file has no settings about bridge vlan, networkd keeps the currently assigned vlan IDs. That's intended, to make not break existing setups. When a .network file has only PVID=no line in [BridgeVLAN] section, then all assigned vlan IDs are removed. Fixes #29975. Closes #15291.
* network/brvlan: read bridge vlan IDs through netlink and save themYu Watanabe2023-11-121-0/+6
| | | | | In this commit, obtained vlan IDs are not used, but they will be used in the later commits.
* network/dhcp-pd: use correct flag when DHCPv4 6rd is enabledYu Watanabe2023-11-101-1/+1
| | | | | | | | Previously, Link.dhcp6_configured flag was unconditionally used even if the route is configured based on the DHCPv4 protocol. Follow-up for a27588d4e7f780243a1828e2af56562f9d779412 and e49bad0179cb670edeac12ef062887af0ac4c8c5.
* network/dhcp4: support IPv6 only mode (RFC 8925)Yu Watanabe2023-10-111-0/+1
| | | | Co-authored-by: Susant Sahani <ssahani@gmail.com>
* network: ndisc - Allow to parse PREF64 prefixSusant Sahani2023-09-041-0/+1
|
* network/ipv4acd: split out sd_ipv4acd management from Address to LinkYu Watanabe2023-07-301-0/+2
| | | | | | | | Then, we can start IPv4ACD without adding corresponding Address object to Link. Hopefully, no functional change, just refactoring and preparation for later commits.
* network: handle captive portal with multiple routersYu Watanabe2023-07-061-1/+1
| | | | | | | | | | 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.
* ndisc: parse RFC8910 captive portal ipv6ra optionRonan Pigott2023-07-021-0/+1
|
* network: wifi: try to reconfigure when connectedYu Watanabe2022-11-221-0/+1
| | | | | | | | | | Sometimes, RTM_NEWLINK message with carrier is received earlier than NL80211_CMD_CONNECT. To make SSID= or other WiFi related settings in [Match] section work, let's try to reconfigure the interface. Fixes a bug introduced by 96f5f9ef9a1ba5146d3357c1548fb675d3bd5b68. Fixes #25384.
* network: drop unnecessary prototypeYu Watanabe2022-11-221-1/+0
| | | | Follow-up for a39a9ac8065c29330207838b70fe388bde2bc254.
* network: simplify the logic of reading driver and permanent HW addressYu Watanabe2022-10-311-0/+4
| | | | | | | | No functional changes, just refactoring and preparation for later commits. Note, `link->dev` should always exist when link state is initialized or later.
* 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: manage SR-IOV PF and VF portsYu Watanabe2022-08-051-0/+3
|
* network: split link_ipv4ll_enabled() into twoYu Watanabe2022-08-011-2/+0
| | | | And move it from networkd-link.[ch] to relevant files.
* network: introduce a tiny wrapper for manager_udev_process_link()Yu Watanabe2022-07-231-1/+1
| | | | Preparation for later commits.
* network: rename Link.sd_device -> Link.devYu Watanabe2022-07-231-1/+1
|
* network: drop support for old kernels which cannot set prefix route with ↵Yu Watanabe2022-05-211-2/+0
| | | | | | | | | | | | | | non-main route table Not sure when the issue was fixed. - kernel-3.10 on CentOS 7 has the issue, - kernel-4.18 on CentOS 8 works fine. Note, the workaround dropped by the commit is not incomplete: with an old kernel which has the issue, all non-prefix routes are configured on the specified route table, but the prefix route is configured on the main table. That should not work for most cases, hence, the workaround is mostly meaningless.
* Fix "link-local" language inconsistenciesSebastian Pucilowski2022-03-311-1/+1
| | | | | | "Link-local" and "link local" are used throughout man pages and program output, with the former used far more than the latter. This commit makes it consistent throughout the project.
* network: traffic control: drop meta from QDisc and TClassYu Watanabe2022-02-261-1/+2
| | | | | Since #22248, it is not necessary to manage QDisc and TClass in same Set or Hashmap. Let's manage them independently.
* network: drop unused flag and counterYu Watanabe2022-02-251-2/+0
|
* network: assign corresponding NetDev object to LinkYu Watanabe2022-02-251-0/+2
|
* Merge pull request #22452 from yuwata/network-ipv6llYu Watanabe2022-02-101-2/+4
|\ | | | | network: use sysctl to set IPv6LL address generation mode when the interface is already up
| * network: monitor current IPv6LL address generation modeYu Watanabe2022-02-101-0/+3
| |
| * network: move ipv6ll related functions to networkd-ipv6ll.[ch]Yu Watanabe2022-02-081-2/+1
| |
* | network: tc: monitor qdisc and tclassYu Watanabe2022-02-091-0/+1
|/