summaryrefslogtreecommitdiff
path: root/net/natmap
diff options
context:
space:
mode:
authorRichard Yu <yurichard3839@gmail.com>2022-12-07 15:18:09 +0800
committerRichard Yu <yurichard3839@gmail.com>2022-12-07 15:18:09 +0800
commit190e04caf69746b862dafdff7b16f539f86a7544 (patch)
tree7783f7afe22e188ddd173d4e73be7d522dea4791 /net/natmap
parent88d33fef91e6bdeb195bf40b80ceb4644334a00b (diff)
natmap: merge "ipv4" and "ipv6" options into single "family" option
Signed-off-by: Richard Yu <yurichard3839@gmail.com>
Diffstat (limited to 'net/natmap')
-rw-r--r--net/natmap/files/natmap.config3
-rw-r--r--net/natmap/files/natmap.init7
2 files changed, 4 insertions, 6 deletions
diff --git a/net/natmap/files/natmap.config b/net/natmap/files/natmap.config
index 519cea052..71931f6c5 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 e729e7275..a9ff90539 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" ] && {