mirror of
https://git.openwrt.org/feed/packages.git
synced 2024-06-14 11:23:57 +02:00
nft-qos: simplify ifname retrieval
network_get_device should be enough, and since https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=4b9a67362d70c544b85078b8d5c661f43f7472d9 uci network config interface sections use 'device' instead of 'ifname', rendering the fallback useless Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
This commit is contained in:
parent
c0742dfbe5
commit
76b750d720
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=nft-qos
|
PKG_NAME:=nft-qos
|
||||||
PKG_VERSION:=1.0.6
|
PKG_VERSION:=1.0.6
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=3
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
|
|
||||||
PKG_MAINTAINER:=Rosy Song <rosysong@rosinson.com>
|
PKG_MAINTAINER:=Rosy Song <rosysong@rosinson.com>
|
||||||
|
|
|
@ -67,8 +67,6 @@ qosdef_remove_priority() {
|
||||||
|
|
||||||
# init traffic priority
|
# init traffic priority
|
||||||
qosdef_init_priority() {
|
qosdef_init_priority() {
|
||||||
local ifname="br-lan"
|
|
||||||
|
|
||||||
[ "$2" = 0 ] || {
|
[ "$2" = 0 ] || {
|
||||||
logger -t nft-qos-priority "validation failed"
|
logger -t nft-qos-priority "validation failed"
|
||||||
return 1
|
return 1
|
||||||
|
@ -76,16 +74,12 @@ qosdef_init_priority() {
|
||||||
|
|
||||||
[ $priority_enable -eq 0 ] && return 1
|
[ $priority_enable -eq 0 ] && return 1
|
||||||
|
|
||||||
case "$priority_netdev" in
|
local ifname
|
||||||
lan) [ "$(uci_get network.lan.type)" != "bridge" ] && {
|
network_get_device ifname "$priority_netdev"
|
||||||
network_get_device ifname "$priority_netdev" || \
|
[ -n "$ifname" ] || {
|
||||||
ifname="$(uci_get network.lan.ifname)"
|
logger -t nft-qos-priority "unable to get ifname for $priority_netdev"
|
||||||
}
|
return 1
|
||||||
;;
|
}
|
||||||
wan*) network_get_device ifname "$priority_netdev" || \
|
|
||||||
ifname="$(uci_get network.$priority_netdev.ifname)"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
qosdef_appendx "table netdev nft-qos-priority {\n"
|
qosdef_appendx "table netdev nft-qos-priority {\n"
|
||||||
qosdef_append_chain_priority filter priority $ifname
|
qosdef_append_chain_priority filter priority $ifname
|
||||||
|
|
Loading…
Reference in New Issue
Block a user