summaryrefslogtreecommitdiffstats
path: root/src/network (follow)
Commit message (Collapse)AuthorAgeFilesLines
* networkd: add possibility to specify MulticastIGMPVersionMichele Dionisio2024-11-065-0/+44
|
* network: reconfigure interface more gracefully (#35035)Yu Watanabe2024-11-0627-395/+507
|\ | | | | split-out of #34989.
| * network: introduce LINK_RECONFIGURE_CLEANLY flagYu Watanabe2024-11-053-3/+4
| | | | | | | | | | | | 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: keep dynamic configurations as possible as we can on reconfigureYu Watanabe2024-11-0513-42/+275
| | | | | | | | | | | | | | | | | | | | 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
| * network: merge link_foreignize_config() and link_drop_foreign_config()Yu Watanabe2024-11-0511-221/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a reconfiguration of an interface is triggered, previously we call link_foreignize_config(), which sets all static configurations as foreign, then later call link_drop_foreign_config(), which drops unnecessary foreign configurations. This commit merges these two steps into one, link_drop_unmanaged_config(), which drops unnecessary static and foreign configurations. Also, this renames link_drop_managed_configs() to link_drop_static_config(), as it only drops static configurations. Note that dynamically aquired configurations are dropped by link_stop_engines().
| * network: several cleanups for link_reconfigure()Yu Watanabe2024-11-055-111/+81
| | | | | | | | | | | | | | | | | | | | | | | | 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: split out link_enter_unmanaged() from link_reconfigure_impl()Yu Watanabe2024-11-051-29/+43
| | | | | | | | No functional change, just refactoring.
* | mount-util: introduce path_is_network_fs_harder() and use it in networkd ↵Zbigniew Jędrzejewski-Szmek2024-11-061-4/+6
|\ \ | | | | | | | | | | | | (#35040) Closes #32426.
| * | network: use path_is_network_fs_harder()Yu Watanabe2024-11-051-4/+6
| | | | | | | | | | | | Closes #32426.
* | | network: handle ENODATA better with DNRRonan Pigott2024-11-052-38/+38
|/ / | | | | | | | | | | | | | | It is normal for DHCP leases not to have DNR options. We need to be less verbose and more forgiving in these cases. Also, if either DHCP does not have DNR options, make sure to still consider any DHCPv6/RA options. Fixes: c7c9e3c7c016 (network: adjust log message about DNR)
* / tree-wide: time-out → timeoutZbigniew Jędrzejewski-Szmek2024-11-051-1/+1
|/ | | | For justification, see 3f9a0a522f2029e9295ea5e9984259022be88413.
* network: limit the total number of Encrypted DNS options processedRonan Pigott2024-11-051-0/+6
| | | | | | | We need a sensible limit on the number of Encrypted DNS options allowed so that the set of resolvers per link does not grow without bound. Fixes: 0c90d1d2f243 ("ndisc: Parse RFC9463 encrypted DNS (DNR) option")
* network/dhcp4: keep DHCP address and routes on stop even when SendDecline=yesYu Watanabe2024-11-041-5/+5
| | | | | KeepConfiguration=dhcp or dhcp-on-stop already violate RFC. It is not necessary to honor the RFC about sending decline message on stop.
* network: expose log_route_debug() and log_address_debug()Yu Watanabe2024-11-044-2/+6
| | | | They will be used in another file in a later commit.
* network: add more debugging logsYu Watanabe2024-11-042-8/+21
| | | | | This also fixes the position of the logging "Enumeration completed.", and downgrade its log level.
* network: check if interface is initialized after enumeration completedYu Watanabe2024-11-043-1/+22
| | | | | | | | 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: check earlier if we are running in test modeYu Watanabe2024-11-041-13/+20
|
* network: introduce network_config_source_from_string()Yu Watanabe2024-11-042-1/+2
| | | | | It is currently unused, but will be used later. Preparation for later commits.
* network/json: add missing entries for route propertiesYu Watanabe2024-11-041-0/+2
|
* network: remove unexpected netlink socket from service managerYu Watanabe2024-11-041-2/+2
|
* network/address: slightly optimize link_address_is_dynamic()Yu Watanabe2024-11-041-1/+5
|
* network: realign string tableYu Watanabe2024-11-041-5/+5
|
* json: add json_dispatch_ifindex() helper (#34982)Lennart Poettering2024-11-042-6/+6
|\ | | | | Inspired by: #34640
| * tree-wide: port things over to new json_dispatch_ifindex()Lennart Poettering2024-11-042-6/+6
| |
* | network: refuse new requests on stop (#35004)Luca Boccassi2024-11-047-5/+28
|\ \ | | | | | | split-out of #34989..
| * | network: free DHCP client and friends in link_free()Yu Watanabe2024-11-033-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: refuse further requests when manager is in MANAGER_STOPPEDYu Watanabe2024-11-034-0/+26
| |/ | | | | | | | | In that case, requests will never be processed anyway. But further more, we cannot call link_ref() at that stage. Otherwise, we trigger assertion.
* | network/ipv4ll: not necessary to set initial address on each startYu Watanabe2024-11-022-13/+16
| |
* | network/dhcp4: do not restart IPv4LL client when KeepConfiguration=dhcpYu Watanabe2024-11-021-5/+5
|/ | | | | When KeepConfiguration=dhcp, we do not remove acquired address, hence not necessary to restart IPv4LL client.
* network: update tunnel or vxlan interface if the local address is changedYu Watanabe2024-10-3110-2/+75
| | | | | | | 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/netdev: replace old NetDev object with newer one on reloadYu Watanabe2024-10-303-2/+80
| | | | | | | | | | | | | | | | | | | Then, when a .netdev file of a stacked netdev is modified, the netdev can be reconfigured with the updated setting by something like the following way: ``` ip link del vlan99 networkctl reload ``` Note, removing the vlan interface in the above example may not be necessary, e.g. when only VLAN flags, egress mapping, or ingress mapping are updated. But, it is necessary when VLAN ID is updated. Closes #9627. Closes #27177. Closes #34907. Replaces #22557.
* network/netdev: reconfigure netdev if possibleYu Watanabe2024-10-301-8/+5
| | | | | Some netdev configs can be modified after the interface is created. Let's allow to reconfigure existing interfaces.
* network/netdev: move calls of netdev_attach() and netdev_request_to_create() ↵Yu Watanabe2024-10-303-22/+24
| | | | | | to netdev_load() No functional change, preparation for later commits.
* network/tunnel: reuse existing 6rd sit tunnel (#34938)Yu Watanabe2024-10-303-75/+45
|\ | | | | split-out of #34909.
| * network/tunnel: reuse existing 6rd SIT tunnelYu Watanabe2024-10-293-31/+19
| | | | | | | | | | The 6rd SIT tunnel configuration can be updated without recreating the interface. Let's reuse existing tunnel.
| * network/tunnel: merge dhcp4_pd_create_6rd_tunnel_message() into ↵Yu Watanabe2024-10-292-47/+29
| | | | | | | | | | | | | | dhcp4_pd_create_6rd_tunnel() No functional change, just refactoring and preparation for later commits.
* | network/netdev: do not try to update several parameters if the interface ↵Yu Watanabe2024-10-305-36/+98
|\ \ | | | | | | | | | | | | already exists (#34937) split-out of #34909.
| * | network/ipvlan: do not try to update MAC addressYu Watanabe2024-10-301-0/+9
| | |
| * | network/macsec: IFLA_MACSEC_PORT attribute cannot be changedYu Watanabe2024-10-301-6/+14
| | | | | | | | | | | | | | | | | | Also, though currently not supported by networkd, IFLA_MACSEC_CIPHER_SUITE, IFLA_MACSEC_ICV_LEN, IFLA_MACSEC_SCI cannot be updated.
| * | network/vxlan: do not try to update several parametersYu Watanabe2024-10-301-28/+42
| | | | | | | | | | | | | | | Currently, netdev->ifindex is always zero when this function is called. So, this does not change any behavior. Preparation for later commits.
| * | network/netdev: introduce netdev_can_set_mac/mtu() helper functionsYu Watanabe2024-10-302-2/+33
| | | | | | | | | | | | | | | | | | Several netdevs cannot set IFLA_ADDRESS or IFLA_MTU attribute on update. Currently, the vtable field is unused, as we do not support updating existing netdevs. Preparation for later commits.
* | | network: several cleanups for reloading .network files (#34933)Yu Watanabe2024-10-306-24/+61
|\ \ \ | | | | | | | | split-out of #34909.
| * | | network: use newly loaded Network object if a referenced NetDev object is ↵Yu Watanabe2024-10-301-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | updated Even if .network file is not updated, referenced NetDev object may be different. In that case, let's use the newly loaded Network object.
| * | | network: drop no-op cleanupYu Watanabe2024-10-305-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - network_load() is always called with an empty OrderedHashmap, renamed the output parameter to 'ret'. - When netdev_load() is called on startup, the hashmap is NULL. When it is called on reloading, the hashmap is not cleaned up. Hence, then these cleanups are always no-op. Let's drop them.
| * | | network/netdev: update state file when NetDev object assignment is changedYu Watanabe2024-10-301-6/+17
| | | |
| * | | network: swap asterisk and spaceYu Watanabe2024-10-302-4/+4
| |/ /
* / / network: process queued remove requests before networkd is stoppedYu Watanabe2024-10-304-21/+73
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | network/tunnel: allow Local=/Remote=any for all tunnel typesYu Watanabe2024-10-301-21/+14
| | | | | | | | | | | | It seems there is no restriction for local and remote addresses. Fixes #34930.
* | sd-netlink,network: do not set NLM_F_CREATE and NLM_F_EXCL flags if an ↵Yu Watanabe2024-10-304-16/+0
| | | | | | | | | | | | | | | | interface index is specified If an ifindex is specified, we are modifying the existing interface. Hence, these flags should not be set. Otherwise, the request will be refused with -EEXIST.
* | network/netdev: skip processing netdev if it is already detachedYu Watanabe2024-10-2910-0/+55
| | | | | | | | | | | | No functional change, as currently networkd detaches NetDev objects only on stop (or invalid .netdev file is loaded). Preparation for later commits.