From 9542111b1402e9aeebb38ace7ed7832503e7ed1b Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 20 Apr 2026 22:04:28 +0530 Subject: [PATCH] keepalived: fix print_track_script_indent func Removed unnecessary option value. This was not needed as option name is already being used. Also removed a condition where the section was not parsed if option value was not given. Value was being used to name the script. Now the option name is used as the name when the script is called in track_script. Also added a condition where the section is not parsed if option name is not given. This is because the script cannot be called if it does not have a name. No upgrade script is required. The removed `value` option in `vrrp_script` was previously used to identify scripts referenced by `track_script`. However, this mechanism was non-functional: - `track_script` attempted to reference a `track_script` section, which is not implemented in the UCI configuration. - As a result, script references were not resolved correctly even if `value` was defined. With this change, `track_script` now correctly references the `vrrp_script` section, and the `name` option is used as the identifier. Since the previous behavior was not working as intended, removing the `value` option does not break any valid existing configurations. Signed-off-by: Rishabh --- net/keepalived/files/keepalived.init | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index 59b798e203..dda66e822d 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -219,16 +219,14 @@ print_track_script_indent() { local name value weight direction config_get name "$section" name - [ "$name" != "$curr_track_elem" ] && return 0 + [ -z "$name" ] && return 0 - config_get value "$section" value config_get weight "$section" weight config_get direction "$section" direction - [ -z "$value" ] && return 0 [ "$direction" != "reverse" ] && [ "$direction" != "noreverse" ] && unset direction - printf '%b%s' "$indent" "$value" >> "$KEEPALIVED_CONF" + printf '%b%s' "$indent" "$name" >> "$KEEPALIVED_CONF" [ -n "$weight" ] && printf ' weight %s' "$weight ${direction:+${direction}}" >> "$KEEPALIVED_CONF" printf '\n' >> "$KEEPALIVED_CONF" }