summaryrefslogtreecommitdiff
path: root/net/siproxd/files/siproxd.init
diff options
context:
space:
mode:
authorJiri Slachta <jiri@slachta.eu>2023-11-25 22:45:44 +0100
committerGitHub <noreply@github.com>2023-11-25 22:45:44 +0100
commit04666c3abbff8ecbbbb835c35fe91ce7d8da7c91 (patch)
tree06c41056c6409c16bfccbed1fcee150943cacca0 /net/siproxd/files/siproxd.init
parentb28229fb59c8d6984a3213ea27f578d38ddadbcd (diff)
parent7ab8207ba736af328907ff6d94761a54cbeadad5 (diff)
Merge pull request #843 from guidosarducci/master-fix-network-device
siproxd: improve network device resolution
Diffstat (limited to 'net/siproxd/files/siproxd.init')
-rw-r--r--net/siproxd/files/siproxd.init12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/siproxd/files/siproxd.init b/net/siproxd/files/siproxd.init
index dd932bd..0ff636b 100644
--- a/net/siproxd/files/siproxd.init
+++ b/net/siproxd/files/siproxd.init
@@ -39,6 +39,12 @@ append_conf() {
echo $* >> "$CONF_DIR/siproxd-$sec.conf"
}
+# Resolve network device by layer 3 first, then layer 2
+
+siproxd_get_device() {
+ network_get_device $1 $2 || network_get_physdev $1 $2
+}
+
# Use user-friendly network names (e.g. "wan", "lan") from options
# 'interface_inbound' and 'interface_outbound', but use standard siproxd
# parameters 'if_inbound' and 'if_outbound' if explicitly set.
@@ -51,9 +57,8 @@ setup_networks() {
config_get _int_inbound "$sec" interface_inbound
config_get _int_outbound "$sec" interface_outbound
- . /lib/functions/network.sh
- network_get_physdev _dev_inbound $_int_inbound
- network_get_physdev _dev_outbound $_int_outbound
+ siproxd_get_device _dev_inbound $_int_inbound
+ siproxd_get_device _dev_outbound $_int_outbound
default_conf if_inbound $_dev_inbound
default_conf if_outbound $_dev_outbound
@@ -165,6 +170,7 @@ start_service() {
chmod 755 "$CONF_DIR" "$REG_DIR" "$PID_DIR"
chown "$SIPROXD_UID:$SIPROXD_GID" "$REG_DIR"
+ . /lib/functions/network.sh
siproxd_cb
config_load 'siproxd'
}