diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-11-06 09:57:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-06 09:57:56 +0100 |
commit | df69f29728f8324075951060217e7821a793fcb4 (patch) | |
tree | a3260bfb5b396eb9d6cdb63362b8743b5d4fe6c9 /src/network/networkd-link.h | |
parent | UKI: Introduce `.dtbauto` sections (#34855) (diff) | |
parent | network: introduce LINK_RECONFIGURE_CLEANLY flag (diff) | |
download | systemd-df69f29728f8324075951060217e7821a793fcb4.tar.xz systemd-df69f29728f8324075951060217e7821a793fcb4.zip |
network: reconfigure interface more gracefully (#35035)
split-out of #34989.
Diffstat (limited to 'src/network/networkd-link.h')
-rw-r--r-- | src/network/networkd-link.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/network/networkd-link.h b/src/network/networkd-link.h index 1c5c9ec709..ad8bac7ad6 100644 --- a/src/network/networkd-link.h +++ b/src/network/networkd-link.h @@ -42,6 +42,11 @@ typedef enum LinkState { _LINK_STATE_INVALID = -EINVAL, } LinkState; +typedef enum LinkReconfigurationFlag { + LINK_RECONFIGURE_UNCONDITIONALLY = 1 << 0, /* Reconfigure an interface even if .network file is unchanged. */ + LINK_RECONFIGURE_CLEANLY = 1 << 1, /* Drop all existing configs before reconfiguring. Otherwise, reuse existing configs as possible as we can. */ +} LinkReconfigurationFlag; + typedef struct Manager Manager; typedef struct Network Network; typedef struct NetDev NetDev; @@ -259,9 +264,11 @@ LinkState link_state_from_string(const char *s) _pure_; int link_request_stacked_netdevs(Link *link, NetDevLocalAddressType type); -int link_reconfigure_impl(Link *link, bool force); -int link_reconfigure(Link *link, bool force); -int link_reconfigure_on_bus_method_reload(Link *link, sd_bus_message *message); +int link_reconfigure_impl(Link *link, LinkReconfigurationFlag flags); +int link_reconfigure_full(Link *link, LinkReconfigurationFlag flags, sd_bus_message *message, unsigned *counter); +static inline int link_reconfigure(Link *link, LinkReconfigurationFlag flags) { + return link_reconfigure_full(link, flags, NULL, NULL); +} int link_check_initialized(Link *link); |