Skip to content
Snippets Groups Projects
Commit 1801a765 authored by Markus Gothe's avatar Markus Gothe :ok_hand:
Browse files

airoha: Allow aribtrary portmapping in UCI.

parent 42c25b32
No related branches found
No related tags found
1 merge request!1397airoha: Allow aribtrary portmapping in UCI.
...@@ -6,7 +6,8 @@ WANDEV= ...@@ -6,7 +6,8 @@ WANDEV=
LANDEVS= LANDEVS=
tc3162_eth_portmap() { tc3162_eth_portmap() {
wan_port="-1" local wan_port="-1"
local portmap port i
case "$WANDEV" in case "$WANDEV" in
eth0.[0-9]) eth0.[0-9])
...@@ -15,13 +16,10 @@ tc3162_eth_portmap() { ...@@ -15,13 +16,10 @@ tc3162_eth_portmap() {
esac esac
portmap="${wan_port}" portmap="${wan_port}"
j=1 for i in $(seq 1 6); do
for i in `seq 1 6`; do
iface="$(echo $LANDEVS | cut -d' ' -f$j)"
port="-1" port="-1"
if [ "${i}" -ne "${wan_port}" ]; then if [ "${i}" -ne "${wan_port}" ]; then
[ "${iface:0:5}" = "eth0." ] && port=${iface#eth0.} echo $LANDEVS | tr ' ' '\n' | grep -qxF "eth0.${i}" && port=$i
j=$((j+1))
fi fi
portmap="${portmap} ${port}" portmap="${portmap} ${port}"
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment