--- zzzz-none-000/linux-4.9.279/net/ipv6/ip6_output.c 2021-08-08 06:38:54.000000000 +0000 +++ puma7-atom-6591-750/linux-4.9.279/net/ipv6/ip6_output.c 2023-02-08 11:43:43.000000000 +0000 @@ -25,6 +25,10 @@ * : add ip6_append_data and related functions * for datagram xmit */ +/* + * Includes Intel Corporation's changes/modifications dated: 2018, 2020. + * Changed/modified portions - Copyright (c) 2018 - 2020, Intel Corporation. + */ #include #include @@ -58,6 +62,19 @@ #include #include +#ifdef CONFIG_TI_DOCSIS_INPUT_DEV +# define DBRIDGE_IFINDEX_CHK(__ifindex, format, args...) \ +{ \ + if (((__ifindex) < 0) || ((__ifindex) >= TI_MAX_DEVICE_INDEX)) \ + { \ + printk("\n===>>> %s - %d: Currupt " #__ifindex " - %d\n" format, __func__, __LINE__, __ifindex, ##args); \ + BUG(); \ + } \ +} +#endif + +#include + static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff *skb) { struct dst_entry *dst = skb_dst(skb); @@ -65,6 +82,11 @@ struct neighbour *neigh; struct in6_addr *nexthop; int ret; +#ifdef CONFIG_TI_PACKET_PROCESSOR +#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) + const struct nf_conn *ct; +#endif +#endif skb->protocol = htons(ETH_P_IPV6); skb->dev = dev; @@ -104,6 +126,15 @@ return 0; } } +#ifdef CONFIG_TI_PACKET_PROCESSOR +#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) + ct = (struct nf_conn *)skb->nfct; + if (ct != NULL) + { + ti_hil_pp_event( TI_CT_NETFILTER_CANCEL_DISCARD_ACCELERATION, skb->nfct); + } +#endif +#endif if (lwtunnel_xmit_redirect(dst->lwtstate)) { int res = lwtunnel_xmit(skb); @@ -250,6 +281,10 @@ if (unlikely(!skb)) return 0; + /* 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 */ @@ -359,6 +394,8 @@ __IP6_INC_STATS(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTFORWDATAGRAMS); __IP6_ADD_STATS(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTOCTETS, skb->len); + avm_pa_mark_routed(skb); + return dst_output(net, sk, skb); } @@ -579,7 +616,28 @@ #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); + +#ifdef CONFIG_TI_DOCSIS_INPUT_DEV + to->ti_docsis_input_dev = from->ti_docsis_input_dev; + if (to->ti_docsis_input_dev) + { + DBRIDGE_IFINDEX_CHK(to->ti_docsis_input_dev->ifindex, "dev %p, devname %s, ti_docsis_input_dev %p, ti_docsis_input_dev->name %s", to->dev, to->dev ? to->dev->name : NULL, to->ti_docsis_input_dev, to->ti_docsis_input_dev->name); + } +#endif /* CONFIG_TI_DOCSIS_INPUT_DEV */ +#ifdef CONFIG_INTEL_DOCSIS_ICMP_IIF + to->docsis_icmp_iif = from->docsis_icmp_iif; +#endif /* CONFIG_INTEL_DOCSIS_ICMP_IIF */ +#ifdef CONFIG_TI_L2_SELECTIVE_FORWARDER + to->ti_selective_fwd_dev_info = from->ti_selective_fwd_dev_info; +#endif /* CONFIG_TI_L2_SELECTIVE_FORWARDER */ +#ifdef CONFIG_TI_PACKET_PROCESSOR + memcpy((void *)SKB_GET_PP_INFO_P(to), (void *)SKB_GET_PP_INFO_P(from), sizeof(*SKB_GET_PP_INFO_P(from))); +#endif + skb_copy_secmark(to, from); } @@ -878,6 +936,7 @@ kfree_skb(skb); return err; } +EXPORT_SYMBOL(ip6_fragment); static inline int ip6_rt_check(const struct rt6key *rt_key, const struct in6_addr *fl_addr,