From c6ac63b5c0c5aa66a6e701a116fcb12922320187 Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Mon, 12 Dec 2022 02:52:59 +0000 Subject: [PATCH] pbr: detect missing iptables Signed-off-by: Stan Grishin (cherry picked from commit a86985879fa117782dc232122819e9bbb93be175) --- net/pbr/Makefile | 2 +- net/pbr/files/etc/init.d/pbr.init | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/net/pbr/Makefile b/net/pbr/Makefile index 0f2842ed81..4a7255c487 100644 --- a/net/pbr/Makefile +++ b/net/pbr/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pbr PKG_VERSION:=1.0.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Stan Grishin diff --git a/net/pbr/files/etc/init.d/pbr.init b/net/pbr/files/etc/init.d/pbr.init index cf807f4334..22c8b03a23 100755 --- a/net/pbr/files/etc/init.d/pbr.init +++ b/net/pbr/files/etc/init.d/pbr.init @@ -109,6 +109,7 @@ get_text() { case "$1" in errorConfigValidation) r="Config ($packageConfigFile) validation failure!";; errorNoIpFull) r="ip-full binary cannot be found!";; + errorNoIptables) r="iptables binary cannot be found!";; errorNoIpset) r="Resolver set support (${resolver_set}) requires ipset, but ipset binary cannot be found!";; errorNoNft) r="Resolver set support (${resolver_set}) requires nftables, but nft binary cannot be found!";; errorResolverNotSupported) r="Resolver set (${resolver_set}) is not supported on this system!";; @@ -336,6 +337,12 @@ load_environment() { state add 'errorSummary' 'errorNoIpFull' return 1 fi + if ! is_nft; then + if [ -z "$iptables" ] || [ ! -x "$iptables" ]; then + state add 'errorSummary' 'errorNoIptables' + return 1 + fi + fi resolver 'check_support' fi -- 2.30.2