Commit Graph

114 Commits

Author SHA1 Message Date
Rishabh 2482fdd481 keepalived: bump PKG_RELEASE to 3
Bump PKG_RELEASE from 2 to 3.

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh 0fc6a409c2 keepalived: update config for option track_script
Update config for option track_script in vrrp_instance to use vrrp_script
instead of track_script

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh 3fb01d67c7 keepalived: remove config section track_script
Remove config section for track_script from keepalived.config
as it is not supported.

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh 09143ea2b2 keepalived: update config for vrrp_script section
Update config for vrrp_script in keepalived.config.
Add option name, direction and timeout in config.
Add some docs for option weight and option direction.

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh 777925d423 keepalived: add option track_bfd in vrrp_instance
Update keepalived.config to add track_bfd option in vrrp_instance

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh 7673eab565 keepalived: add config for section peer
Update keepalived.config to add config for section peer.
`peer` is a section that can be used via 'list unicast_peer'

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh b3a0f57c4f keepalived: add config for bfd_instance
Add config for bfd_instance in keepalived.config.
This includes all currently supported options.

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh 361beae4ed keepalived: add config for track_script in sync group
Update keepalived.config to add track_script option in vrrp_sync_group

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh b3f5280ca9 keepalived: add option timeout in vrrp_script
Add option timeout in vrrp_script section.
This option specifies the timeout duration for script execution.

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh efed5cf1a6 keepalived: use section vrrp_script for option track_script
`track_script` and `vrrp_script` are both sections that run custom scripts
which handle priority of a vrrp_instance.
`track_script` is not supported by this uci implementation

`vrrp_instance` was still trying to fetch config for track_script from section
'track_script'.

After the changes, when listing track_script in vrrp_instance,
it tries to fetch config from section `vrrp_script` which is supported.

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh 82f99e0815 keepalived: add track_script to vrrp_sync_group
Add logic to parse track_script section for vrrp_sync_group.
Keepalived supports script tracking in vrrp_sync_group but this was not
implemented by the uci implementation.

Note that if a vrrp_script is added to a sync group, you cannot use
priority/weight for that script as a vrrp_sync_group does not have a
priority/weight attached to it. It will do up/down as whole.

This option is optional and wouldn't affect any older configurations
during upgrade.

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh 22919cd685 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 <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh 9542111b14 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 <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh 0046dd5648 keepalived: use extended config_section open/close functions
The new updated config_section_open and close functions are now used in places
where they can be used. The following sections use these functions:

(inside vrrp_instance)
    - virtual_ipaddress
    - virtual_routes
    - track_script
    - track_interface
    - track_bfd
    - unicast_peer

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Rishabh c75235e523 keepalived: add indent param in config_section_open/close
Add a parameter for indent in config_section_open and
config_section_close. Previously you had to separately add indents
while parsing if a section was inside another section.
Now this is supported by these two functions.
You can specify how much indent you need to add before opening or closing
a section.

Signed-off-by: Rishabh <rishabhshah2005@gmail.com>
2026-04-27 14:28:04 +02:00
Florian Eckert 71dbf1cc0d keepalived: add enabled option
To prevent the keepalived service from starting if there is no valid
configuration yet, the new option enabled is added. This must be set to
true for keepalived to start.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-09-04 08:34:13 +02:00
Florian Eckert 1d79439834 keepalived: only add content to config file if needed
Only add the first two pieces of information to the configuration file if
there is a valid '/etc/config/keepalived'.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-09-04 08:34:13 +02:00
Florian Eckert 9db0eab9c5 keepalived: enable reproducible-build
Before keepalived version '2.3.0' the compilation was not reproducable
because the compile date and other information has been added to the binary.

Starting with version '2.3.0', there is a new compilation option
'--enable-reproducible-build' that makes the binary reproducible.

The data that prevented this has been moved to a separate file,
'/etc/keepalived/keepalived.config-opts'.

This commit enables the reproducable build.

[1] https://github.com/acassen/keepalived/commit/30d2f759783e769c27974d22bab88f7e82dfcdf9

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-09-04 08:34:13 +02:00
Stijn Tintel a21eb339b3 keepalived: bump to 2.3.3
Remove backport patches that are included in this release.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2025-04-30 20:42:05 +02:00
Stijn Tintel 483c2fef80 keepalived: bump to 2.3.2
This requires backporting two upstream commits to avoid a segfault
due to the /etc/iproute2/rt_addrprotos.d and
/usr/share/iproute2/rt_addrprotos.d directories not existing on OpenWrt,
and the following compile error:

In file included from /home/stijn/Development/OpenWrt/openwrt/staging_dir/toolchain-powerpc64_e5500_gcc-13.3.0_musl/include/net/ethernet.h:10,
                 from vrrp.c:44:
/home/stijn/Development/OpenWrt/openwrt/staging_dir/toolchain-powerpc64_e5500_gcc-13.3.0_musl/include/netinet/if_ether.h:115:8: error: redefinition of 'struct ethhdr'
  115 | struct ethhdr {
      |        ^~~~~~
In file included from vrrp.c:43:
/home/stijn/Development/OpenWrt/openwrt/staging_dir/toolchain-powerpc64_e5500_gcc-13.3.0_musl/include/linux/if_ether.h:173:8: note: originally defined here
  173 | struct ethhdr {
      |        ^~~~~~

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2025-03-25 08:26:42 +01:00
Florian Eckert ae038d0773 keepalived: add new uci section config interface_up_down_delays
If an interface that is being used (or tracked) by a VRRP instance goes to
down state, the VRRP instance(s) will, by default, immediately transition to
FAULT state, and when all relevant interfaces are back up again the VRRP
instance(s) will immediately transition to BACKUP state.

This can cause problems if interfaces are bouncing, and so delays can be
specified between the interface state change and the transition to
FAULT/BACKUP state. If the interface returns to its original state before
the delay expires, no associated VRRP instance state transition will occur.

New uci section 'interface_up_down_delay':

config interface_up_down_delays
	option device <device>
	option down_delay <number in seconds>
	option up_delay <number in seconds>

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-02-13 13:34:08 +01:00
Francesco Benini 7c58cd667b keepalived: add support for directory sync
This commit adds support for folder synchronization.
An example is in the 810-files file where it is explained how to
synchronize all hotplug files of keepalived.

Signed-off-by: Francesco Benini <francy.benini@gmail.com>
2025-02-05 08:14:04 +01:00
Florian Eckert 25b156a71b keepalived: add ubus status
The hotplug scripts are called with every state change. When called, the
scripts are processed under '/etc/hotplug.d/keepalived'. This change adds
the functionality that the last state change of the keepalived can be
queried via the ubus.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2025-02-04 13:48:09 +01:00
Martin Schiller 808834b969 keepalived: fix name of globals section in default config
This section was renamed some time ago. Although this would be fixed by
the uci-default migration script, we should set this correctly in the
example config file right away.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2024-12-03 15:35:33 +01:00
Stijn Tintel 138766c962 keepalived: bump to 2.3.1
Release notes:
https://www.keepalived.org/release-notes/Release-2.3.1.html

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2024-10-29 10:41:41 +01:00
Stijn Tintel eee70036ae keepalived: bump to 2.3.0
Release notes:
https://www.keepalived.org/release-notes/Release-2.3.0.html

Drop upstreamed patch 0001-vrrp-remove-logging-on-status-output.patch.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2024-10-29 10:41:41 +01:00
Francesco Benini 30f383c8a8 keepalived: fix dnsmasq reload
When "set_reload_if_sync" is set, the service is reloaded when the
configuration changes. For dnsmasq this means that the service, if
stopped, is started, and we don't want this in the backup node.

Signed-off-by: Francesco Benini <francy.benini@gmail.com>
2024-10-22 15:46:27 +02:00
Francesco Benini ac72a52fd9 keepalived: fix ambigiuos functions in hotplug.sh
When "set_reload_if_sync" is not set in the hotplug script, the service
is not expected to reload. That is not true because even if not set, the
value is set to the default 1 (reload active) or equals the parameter
set when "keepalived_hotplug" is called.
The default behavior should be:
    - Reload if set_reload_if_sync is called
    - NOT reload if set_reload_if_sync is NOT called
A similar fix is ported to "set_update_target".

Signed-off-by: Francesco Benini <francy.benini@gmail.com>
2024-10-22 15:46:27 +02:00
Francesco Benini ea092363d9 keepalived: add option to override service running check
Some init.d scripts like firewall and sqm do not return the actual state
of the service if called with "running" parameter. This result in the
init script called with "start" parameter and the service may not load
the new configuration. Firewall init script is one of this
An option is added in order to skip the "running" check for the service.

Signed-off-by: Francesco Benini <francy.benini@gmail.com>
2024-10-22 15:46:27 +02:00
Florian Eckert b0f5e1f3c8 Merge pull request #24037 from TDT-AG/pr/20240429-keepalived
keepalived: remove not supported notify script handling
2024-06-05 08:27:35 +02:00
Florian Eckert 335c0bb62d keepalived: add patch to remove log message on json output
The 'luci-app-keepalived' uses the status json output to parse this
information for the status page. The problem is that when the LuCI
status page is open in the browser, the query is logged every 3 second into
the syslog. This is not needed and can therefore be removed.

This patch was already merged upstream:
https://github.com/acassen/keepalived/commit/6cce75f4eb65551a61d2e4ba775637b288c1d592

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-05-08 11:04:37 +02:00
Florian Eckert c02f124229 keepalived: remove not supported notify script handling
This is not supported by keepalived uci configuration. If a script
should be called by a notify event, then the script must be placed under
the directory '/etc/hotplug.d/keepalived'.

Reported-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-04-29 10:22:13 +02:00
Florian Eckert 7889c520b7 keepalived: remove file sync handling for ucitrack
The ucitrack file hanlding was converted to json. Therefore this is not
needed anymore.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-04-16 08:44:55 +02:00
Florian Eckert f9ed5a9f3a keepalived: add missing no_accept option
This commit adds the missing option 'no_accept'.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-10-30 14:09:36 +01:00
Florian Eckert eb2ed20645 keepalived: add startup and shutdown script handling
The keepalived does support script call handling on start and stop.

All scripts located under '/etc/hotplug.d/keepalived' gets now called
with the env ACTION set to startup or shutdown. The script that want to
get called on this keepalived events could evalutate this env to run on
startup or shutdown.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-10-30 14:09:36 +01:00
Florian Eckert 09f20658d9 keepalived: add notify_up and notify_down for virtual server
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-10-04 17:01:04 +02:00
Florian Eckert 5462d06ba8 keepalived: add PING_CHECK to real_server
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-10-04 17:00:42 +02:00
Florian Eckert 5bfbc58983 keepalived: update to version 2.2.8
See release-notes:
https://www.keepalived.org/release-notes/Release-2.2.8.html

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2023-10-04 16:59:46 +02:00
Paul Fertser 0c10c224be treewide: remove AUTORELEASE
Automatically compute and substitute current values for all
$(AUTORELEASE) instances as this feature is deprecated and shouldn't be
used.

The following temporary change was made to the core:

diff --git a/rules.mk b/rules.mk
index 57d7995d4fa8..f16367de87a8 100644
--- a/rules.mk
+++ b/rules.mk
@@ -429,7 +429,7 @@ endef
 abi_version_str = $(subst -,,$(subst _,,$(subst .,,$(1))))

 COMMITCOUNT = $(if $(DUMP),0,$(call commitcount))
-AUTORELEASE = $(if $(DUMP),0,$(call commitcount,1))
+AUTORELEASE = $(if $(DUMP),0,$(shell sed -i "s/\$$(AUTORELEASE)/$(call commitcount,1)/" $(CURDIR)/Makefile))

 all:
 FORCE: ;

And this command used to fix affected packages:

for i in $(cd feeds/packages; git grep -l PKG_RELEASE:=.*AUTORELEASE | \
                              sed 's^.*/\([^/]*\)/Makefile^\1^';);
do
  make package/$i/download
done

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2023-04-21 22:46:58 +02:00
Florian Eckert 887243196d keepalived-sync: switch from busybox-timeout to coreutils-timeout
So that the busybox configuration does not have to be adapted, the
dependency has been changed to coreutils-timeout, which provides the
same functionality.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-10-18 16:00:51 +02:00
Jaymin Patel 33398a38aa keepalived: high-availability files and data sync
add new package keepalived-sync to synchronize files and data
between master and backup node. The master node uses SSH over rsync
to send and the backup node will use inotifywatch to watch received files.

The master node can track rsync.sh script to send configuration file on
a backup node based on the vrrp_script configuration of the same script.

The backup node will have a keepalived-inotify service, which would watch
for newly received files and it would call hotplug event. Each service
can keep its respective script under the keepalived hotplug directory and
executes commands to stop, start service or update any config in real-time.

Whenever a switchover will happen, the backup node would have the latest
config and data files from the master node.

Hotplug events can be used to apply config when files are received.

Signed-off-by: Jaymin Patel <jem.patel@gmail.com>
2022-10-13 16:57:02 +05:30
Jaymin Patel 0f7415b8a8 keepalived: add status rpc and service improvement
- enable json by default to generate json stats
- add rpc to generate json status
- add kmod-nf-ipvs dependencies for virtual servers
- set default vip labels on virtual interfaces
- set process name for keepalived child processes

Signed-off-by: Jaymin Patel <jem.patel@gmail.com>
2022-09-15 17:08:11 +05:30
Francisco Jose Alvarez f514bff2de keepalived: add uci support for track_bfd configuration
Allow the configuration of track_bfd for vrrp instance throught uci

Signed-off-by: Francisco Jose Alvarez <francisco.alvarez@galgus.net>
2022-04-28 18:11:30 +02:00
Florian Eckert eed4277d5c keepalived: fix libip6tc dependency
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-04-06 17:31:58 +02:00
Florian Eckert 209bcc649a keepalived: add missing CONFIG_ prefix to PKG_CONFIG_DEPENDS elements
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-04-06 17:31:49 +02:00
Florian Eckert bacc3a889f keepalived: enable nftables filtering
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-03-14 12:00:31 +01:00
Florian Eckert 792d745a59 keepalived: update version to 2.2.7
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-02-04 08:14:42 +01:00
Stijn Tintel 624d2278e7 keepalived: fix build with IPVS disabled
The genhash binary is only built when IPVS is enabled, so make its
installation depend on IPVS being enabled.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-09-22 16:13:40 +03:00
Florian Eckert 3f5b2d8cb3 keepalived: update to version 2.2.4
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-08-30 11:47:53 +02:00
Florian Eckert bdcb3d5905 keepalived: update to version 2.2.2
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-03-09 09:12:37 +01:00