--- zzzz-none-000/linux-4.19.183/net/ipv4/ip_output.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/net/ipv4/ip_output.c 2023-06-28 08:54:21.000000000 +0000 @@ -75,6 +75,9 @@ #include #include #include +#if defined(CONFIG_BCM_KF_IPV6) +#include +#endif #include #include #include @@ -82,6 +85,8 @@ #include #include +#include + static int ip_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, unsigned int mtu, @@ -111,6 +116,9 @@ skb->protocol = htons(ETH_P_IP); + if (avm_pa_dev_local_out(AVM_PA_NET_IP_DEVINFO(net), skb) == AVM_PA_RX_STOLEN) + return 0; + return nf_hook(NFPROTO_IPV4, NF_INET_LOCAL_OUT, net, sk, skb, NULL, skb_dst(skb)->dev, dst_output); @@ -534,6 +542,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); #if IS_ENABLED(CONFIG_IP_VS) to->ipvs_property = from->ipvs_property; @@ -582,6 +593,22 @@ struct rtable *rt = skb_rtable(skb); int err = 0; +#if defined(CONFIG_BCM_KF_IPV6) + /* + * Do not fragment the packets going to 4in6 tunnel: + * RFC2473 sec 7.2: fragmentation should happen in tunnel + */ + if (rt->dst.dev->type == ARPHRD_TUNNEL6) + { + struct ip6_tnl *tunnel = netdev_priv(rt->dst.dev); + + if (tunnel->parms.proto == IPPROTO_IPIP) + { + return output(net, sk, skb); + } + } +#endif + /* for offloaded checksums cleanup checksum before fragmentation */ if (skb->ip_summed == CHECKSUM_PARTIAL && (err = skb_checksum_help(skb))) @@ -778,6 +805,9 @@ BUG(); left -= len; +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) + blog_xfer(skb2, skb); +#endif /* * Fill in the new header fields. */