keepalived: update print_unicast_peer_indent func
authorRishabh <redacted>
Mon, 20 Apr 2026 16:38:12 +0000 (22:08 +0530)
committerFlorian Eckert <redacted>
Mon, 27 Apr 2026 12:28:04 +0000 (14:28 +0200)
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 <redacted>
net/keepalived/files/keepalived.init

index dda66e822d33d535ee6da177682e86ccef4ed305..3e9c99faf95a16491cf6f1193a198f81a54a51cc 100644 (file)
@@ -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() {
git clone https://git.99rst.org/PROJECT