qosmngr: add support for l3 interfaces

* this commit adds support to use l3 interfaces
  in classification rules.
This commit is contained in:
Markus Gothe 2024-06-06 04:14:38 +00:00 committed by Rahul Thakur
parent f6fdaafe42
commit 2129df6d5f
2 changed files with 13 additions and 0 deletions

View file

@ -16,6 +16,10 @@ init_broute_dscp2pbit_rule() {
DSCP2PBIT_MAPPING=""
}
broute_filter_on_l3_if() {
BR_RULE="$BR_RULE --logical-in $1"
}
broute_filter_on_src_if() {
BR_RULE="$BR_RULE --in-if $1"
}
@ -271,6 +275,12 @@ handle_ebtables_rules() {
config_get traffic_class "$sid" "traffic_class"
config_get protocol "$sid" "proto"
config_get all_interfaces "$sid" "all_interfaces"
config_get l3_ifname "$sid" "l3_ifname"
if [ -n "$l3_ifname" ]; then
broute_filter_on_l3_if "$l3_ifname"
is_l2_rule=1
fi
if [ "$all_interfaces" == "1" ]; then
is_l2_rule=1

View file

@ -137,6 +137,7 @@ handle_iptables_rules() {
config_get ifname "$cid" "ifname"
config_get all_interfaces "$cid" "all_interfaces"
config_get icmp_type "$cid" "icmp_type"
config_get l3_ifname "$cid" "l3_ifname"
#check version of ip
case $src_ip$dest_ip in
@ -154,6 +155,8 @@ handle_iptables_rules() {
if ! [ "$all_interfaces" == "1" ]; then
if [ -n "$ifname" -a "$ifname" != "lo" ]; then
iptables_filter_intf "$ifname"
elif [ -n "$l3_ifname" -a "$l3_ifname" != "lo" ]; then
iptables_filter_intf "$l3_ifname"
fi
fi