From 237c93c7c605dda9dd5e8aa750bf79de1ab2e4b1 Mon Sep 17 00:00:00 2001 From: Coia Prant Date: Wed, 15 Jan 2025 16:21:53 +0000 Subject: [PATCH] ddns-scripts: get l3 device for bind network using curl If pppoe is used for wan access. script set 'eth1' as interface for curl call. The correct interface is however 'pppoe-wan'. These scripts use '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. Follow P/R: #14431 Signed-off-by: Coia Prant --- .../files/usr/lib/ddns/update_cloudflare_com_v4.sh | 4 ++-- net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn.sh | 2 +- net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn_v3.sh | 4 ++-- net/ddns-scripts/files/usr/lib/ddns/update_godaddy_com_v1.sh | 4 ++-- net/ddns-scripts/files/usr/lib/ddns/update_luadns_v1.sh | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh b/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh index f9f6876a1e554..868296ed5ff8d 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh @@ -96,8 +96,8 @@ __PRGBASE="$CURL -RsS -o $DATFILE --stderr $ERRFILE" # 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'" __PRGBASE="$__PRGBASE --interface $__DEVICE" fi diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn.sh b/net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn.sh index 2091be132b2f5..37c1fcc93a41a 100755 --- a/net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn.sh @@ -28,7 +28,7 @@ build_command() { # bind host/IP 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'" __CMDBASE="$__CMDBASE --interface $__DEVICE" fi diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn_v3.sh b/net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn_v3.sh index fd7124cd4c320..1a1675e88593b 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn_v3.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn_v3.sh @@ -112,8 +112,8 @@ __PRGBASE="$CURL -RsS -o $DATFILE --stderr $ERRFILE" # 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'" __PRGBASE="$__PRGBASE --interface $__DEVICE" fi diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_godaddy_com_v1.sh b/net/ddns-scripts/files/usr/lib/ddns/update_godaddy_com_v1.sh index b8d527ca671fc..d733755a2b582 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/update_godaddy_com_v1.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_godaddy_com_v1.sh @@ -93,8 +93,8 @@ __PRGBASE="$CURL -RsS -w '%{http_code}' -o $DATFILE --stderr $ERRFILE" # 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'" __PRGBASE="$__PRGBASE --interface $__DEVICE" fi diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_luadns_v1.sh b/net/ddns-scripts/files/usr/lib/ddns/update_luadns_v1.sh index 5d7954e12543d..bb2d45d53595f 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/update_luadns_v1.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_luadns_v1.sh @@ -76,8 +76,8 @@ __PRGBASE="$CURL -RsS -w '%{http_code}' -o $DATFILE --stderr $ERRFILE" # 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'" __PRGBASE="$__PRGBASE --interface $__DEVICE" fi