[openwrt/openwrt] odhcp6c: use && in if statement on dynamic interfaces
LEDE Commits
lede-commits at lists.infradead.org
Mon Nov 3 03:23:33 PST 2025
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/b0d1a6aa389b2e944c16a42de57ffb8ecd7a44f8
commit b0d1a6aa389b2e944c16a42de57ffb8ecd7a44f8
Author: Florian Eckert <fe at dev.tdt.de>
AuthorDate: Fri Aug 22 10:42:30 2025 +0200
odhcp6c: use && in if statement on dynamic interfaces
It es recommended to use '&&' to improve readability on 'if' statement.
Signed-off-by: Florian Eckert <fe at dev.tdt.de>
---
package/network/ipv6/odhcp6c/files/dhcpv6.script | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script
index bbdd80c904..a664aa13aa 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script
@@ -165,7 +165,7 @@ setup_interface () {
[ -n "$ZONE" ] || ZONE=$(fw3 -q network $INTERFACE 2>/dev/null)
- if [ "$IFACE_MAP" != 0 -a -n "$MAPTYPE" -a -n "$MAPRULE" ]; then
+ if [ "$IFACE_MAP" != 0 ] && [ -n "$MAPTYPE" ] && [ -n "$MAPRULE" ]; then
[ -z "$IFACE_MAP" -o "$IFACE_MAP" = 1 ] && IFACE_MAP=${INTERFACE}_4
json_init
json_add_string name "$IFACE_MAP"
@@ -182,7 +182,7 @@ setup_interface () {
[ -n "$IFACE_MAP_DELEGATE" ] && json_add_boolean delegate "$IFACE_MAP_DELEGATE"
json_close_object
ubus call network add_dynamic "$(json_dump)"
- elif [ -n "$AFTR" -a "$IFACE_DSLITE" != 0 -a -f /lib/netifd/proto/dslite.sh ]; then
+ elif [ -n "$AFTR" ] && [ "$IFACE_DSLITE" != 0 ] && [ -f /lib/netifd/proto/dslite.sh ]; then
[ -z "$IFACE_DSLITE" -o "$IFACE_DSLITE" = 1 ] && IFACE_DSLITE=${INTERFACE}_4
json_init
json_add_string name "$IFACE_DSLITE"
@@ -197,7 +197,7 @@ setup_interface () {
[ -n "$IFACE_DSLITE_DELEGATE" ] && json_add_boolean delegate "$IFACE_DSLITE_DELEGATE"
json_close_object
ubus call network add_dynamic "$(json_dump)"
- elif [ "$IFACE_464XLAT" != 0 -a -f /lib/netifd/proto/464xlat.sh ]; then
+ elif [ "$IFACE_464XLAT" != 0 ] && [ -f /lib/netifd/proto/464xlat.sh ]; then
[ -z "$IFACE_464XLAT" -o "$IFACE_464XLAT" = 1 ] && IFACE_464XLAT=${INTERFACE}_4
json_init
json_add_string name "$IFACE_464XLAT"
More information about the lede-commits
mailing list