From: Rishabh Date: Mon, 20 Apr 2026 16:38:12 +0000 (+0530) Subject: keepalived: update print_unicast_peer_indent func X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=22919cd685886f958cc2a38d6230f079b2c33b9b;p=openwrt-packages.git keepalived: update print_unicast_peer_indent func Added options min_ttl and max_ttl in section peer. These options are supported by keepalived but were not supported by the uci implementation. This allows accepting packets within a specific TTL range. These options are optional and wouldn't affect any older configurations during upgrade. Signed-off-by: Rishabh --- diff --git a/net/keepalived/files/keepalived.init b/net/keepalived/files/keepalived.init index dda66e822..3e9c99faf 100644 --- a/net/keepalived/files/keepalived.init +++ b/net/keepalived/files/keepalived.init @@ -270,7 +270,7 @@ print_unicast_peer_indent() { local section="$1" local curr_track_elem="$2" local indent="$3" - local name address + local name address max_ttl min_ttl config_get name "$section" name [ "$name" != "$curr_track_elem" ] && return 0 @@ -278,7 +278,15 @@ print_unicast_peer_indent() { config_get address "$section" address [ -z "$address" ] && return 0 - printf '%b%s\n' "${indent}" "$address">> "$KEEPALIVED_CONF" + printf '%b%s' "${indent}" "$address" >> "$KEEPALIVED_CONF" + + config_get min_ttl "$section" min_ttl + config_get max_ttl "$section" max_ttl + + [ -n "$min_ttl" ] && printf ' min_ttl %s' "$min_ttl" >> "$KEEPALIVED_CONF" + [ -n "$max_ttl" ] && printf ' max_ttl %s' "$max_ttl" >> "$KEEPALIVED_CONF" + printf '\n' >> "$KEEPALIVED_CONF" + } static_routes() {