ddns-scripts: get l3 device for bind network using curl
authorFlorian Eckert <fe@dev.tdt.de>
Tue, 22 Jun 2021 08:07:22 +0000 (10:07 +0200)
committerFlorian Eckert <fe@dev.tdt.de>
Tue, 22 Jun 2021 08:13:09 +0000 (10:13 +0200)
If pppoe is used for wan access. script set 'eth1' as interface for curl
call. The correct interface is however 'pppoe-wan'.

The script uses 'network_get_physdev' function to get real device for
bind_network but this is wrong. We need instead the l3_device of the the
logical interface.

In case if we don't use pppoe connection - 'l3_device' is equal to real device.

This was reported by the github user `welderpb` with P/R:
 https://github.com/openwrt/packages/pull/14431

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
net/ddns-scripts/Makefile
net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh

index 047eab9c8353825cfd1544f1fbcdaf0a91819b4b..272136f808d78d7c73733a991896a3940f27f55d 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ddns-scripts
 PKG_VERSION:=2.8.2
-PKG_RELEASE:=9
+PKG_RELEASE:=10
 
 PKG_LICENSE:=GPL-2.0
 
index 2a677785ee1ffc0fca857fe6ec5c0e5338654b32..f36d11ca78e302944602bd6a67f6a954be47d760 100644 (file)
@@ -758,8 +758,8 @@ do_transfer() {
                # force network/interface-device to use for communication
                if [ -n "$bind_network" ]; then
                        local __DEVICE
-                       network_get_physdev __DEVICE $bind_network || \
-                               write_log 13 "Can not detect local device using 'network_get_physdev $bind_network' - Error: '$?'"
+                       network_get_device __DEVICE $bind_network || \
+                               write_log 13 "Can not detect local device using 'network_get_device $bind_network' - Error: '$?'"
                        write_log 7 "Force communication via device '$__DEVICE'"
                        __PROG="$__PROG --interface $__DEVICE"
                fi