From ce3e9d4b4b5c04b5bd1a4a37f635a96ee4a8fc9a Mon Sep 17 00:00:00 2001 From: Richard Yu Date: Wed, 7 Dec 2022 15:18:09 +0800 Subject: [PATCH] natmap: merge "ipv4" and "ipv6" options into single "family" option Signed-off-by: Richard Yu (cherry picked from commit 190e04caf69746b862dafdff7b16f539f86a7544) --- net/natmap/files/natmap.config | 3 +-- net/natmap/files/natmap.init | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/net/natmap/files/natmap.config b/net/natmap/files/natmap.config index 519cea052f..71931f6c56 100644 --- a/net/natmap/files/natmap.config +++ b/net/natmap/files/natmap.config @@ -1,7 +1,6 @@ config natmap option enable '0' - option ipv4 '0' - option ipv6 '0' + option family '' option udp_mode '1' option interface '' option interval '' diff --git a/net/natmap/files/natmap.init b/net/natmap/files/natmap.init index e729e72755..a9ff905391 100644 --- a/net/natmap/files/natmap.init +++ b/net/natmap/files/natmap.init @@ -18,8 +18,7 @@ load_interfaces() { validate_section_natmap() { uci_load_validate "${NAME}" natmap "$1" "$2" \ 'enable:bool:1' \ - 'ipv4:bool:0' \ - 'ipv6:bool:0' \ + 'family:string' \ 'udp_mode:bool:0' \ 'interface:string' \ 'interval:uinteger' \ @@ -44,8 +43,8 @@ natmap_instance() { ${stun_server:+-s "$stun_server"} \ ${http_server:+-h "$http_server"} - [ "${ipv4}" = 1 ] && procd_append_param command -4 - [ "${ipv6}" = 1 ] && procd_append_param command -6 + [ "${family}" = ipv4 ] && procd_append_param command -4 + [ "${family}" = ipv6 ] && procd_append_param command -6 [ "${udp_mode}" = 1 ] && procd_append_param command -u [ -n "$interface" ] && { -- 2.30.2