--- zzzz-none-000/linux-4.4.271/net/ipv4/ip_forward.c 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/net/ipv4/ip_forward.c 2023-04-19 10:22:30.000000000 +0000 @@ -39,6 +39,11 @@ #include #include +#include + +int sysctl_ip_use_legacy_tos __read_mostly = 1; +EXPORT_SYMBOL(sysctl_ip_use_legacy_tos); + static bool ip_exceeds_mtu(const struct sk_buff *skb, unsigned int mtu) { if (skb->len <= mtu) @@ -72,6 +77,7 @@ ip_forward_options(skb); skb_sender_cpu_clear(skb); + avm_pa_mark_routed(skb); return dst_output(net, sk, skb); } @@ -143,7 +149,11 @@ !skb_sec_path(skb)) ip_rt_send_redirect(skb); - skb->priority = rt_tos2priority(iph->tos); + /* + * Set skb priority using legacy ToS method if required. + */ + if (sysctl_ip_use_legacy_tos != 0) + skb->priority = rt_tos2priority(iph->tos); return NF_HOOK(NFPROTO_IPV4, NF_INET_FORWARD, net, NULL, skb, skb->dev, rt->dst.dev,