Resolve network devices by first trying 'network_get_device' (L3) and
falling back to 'network_get_physdev' (L2) on failure, which allows using
Wireguard interfaces. Both are needed to avoid breaking existing usage
for some interfaces (e.g. 'wan').
Also add myself as a maintainer.
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
include $(TOPDIR)/rules.mk
PKG_NAME:=siproxd
include $(TOPDIR)/rules.mk
PKG_NAME:=siproxd
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/hb9xar/siproxd.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/hb9xar/siproxd.git
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/package.mk
echo $* >> "$CONF_DIR/siproxd-$sec.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.
# 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.
config_get _int_inbound "$sec" interface_inbound
config_get _int_outbound "$sec" interface_outbound
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
default_conf if_inbound $_dev_inbound
default_conf if_outbound $_dev_outbound
chmod 755 "$CONF_DIR" "$REG_DIR" "$PID_DIR"
chown "$SIPROXD_UID:$SIPROXD_GID" "$REG_DIR"
chmod 755 "$CONF_DIR" "$REG_DIR" "$PID_DIR"
chown "$SIPROXD_UID:$SIPROXD_GID" "$REG_DIR"
+ . /lib/functions/network.sh
siproxd_cb
config_load 'siproxd'
}
siproxd_cb
config_load 'siproxd'
}