--- zzzz-none-000/linux-4.4.271/net/ipv6/ip6_output.c 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/net/ipv6/ip6_output.c 2023-04-19 10:22:30.000000000 +0000 @@ -57,6 +57,8 @@ #include #include +#include + static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff *skb) { struct dst_entry *dst = skb_dst(skb); @@ -234,6 +236,11 @@ if ((skb->len <= mtu) || skb->ignore_df || skb_is_gso(skb)) { IP6_UPD_PO_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_OUT, skb->len); + + /* For UDP, ICMPv6 and XFRM, see __ip6_local_out() */ + if (avm_pa_dev_local_out(AVM_PA_NET_IP6_DEVINFO(net), skb) == AVM_PA_RX_STOLEN) + return 0; + /* hooks should never assume socket lock is held. * we promote our socket to non const */ @@ -343,6 +350,7 @@ IP6_INC_STATS_BH(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTFORWDATAGRAMS); IP6_ADD_STATS_BH(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTOCTETS, skb->len); skb_sender_cpu_clear(skb); + avm_pa_mark_routed(skb); return dst_output(net, sk, skb); } @@ -562,6 +570,9 @@ #ifdef CONFIG_NET_SCHED to->tc_index = from->tc_index; #endif +#ifdef CONFIG_AVM_PA + memcpy(AVM_PKT_INFO(to), AVM_PKT_INFO(from), sizeof(*AVM_PKT_INFO(to))); +#endif nf_copy(to, from); skb_copy_secmark(to, from); }