--- zzzz-none-000/linux-4.19.183/net/ipv4/icmp.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/net/ipv4/icmp.c 2023-06-28 08:54:21.000000000 +0000 @@ -97,6 +97,9 @@ #include #include #include +#include + +#if !(defined(CONFIG_BCM_KF_MAP) && IS_ENABLED(CONFIG_BCM_MAP)) /* * Build xmit assembly blocks @@ -115,6 +118,8 @@ struct ip_options_data replyopts; }; +#endif + /* An array of errno for error messages from dest unreach. */ /* RFC 1122: 3.2.2.1 States that NET_UNREACH, HOST_UNREACH and SR_FAILED MUST be considered 'transient errs'. */ @@ -186,6 +191,8 @@ }; EXPORT_SYMBOL(icmp_err_convert); +#if !(defined(CONFIG_BCM_KF_MAP) && IS_ENABLED(CONFIG_BCM_MAP)) + /* * ICMP control array. This specifies what to do with each ICMP. */ @@ -197,6 +204,8 @@ static const struct icmp_control icmp_pointers[NR_ICMP_TYPES+1]; +#endif + /* * The ICMP socket(s). This is the most convenient way to flow control * our ICMP output as well as maintain a clean interface throughout @@ -368,7 +377,11 @@ return 0; } +#if defined(CONFIG_BCM_KF_MAP) && IS_ENABLED(CONFIG_BCM_MAP) +void icmp_push_reply(struct icmp_bxm *icmp_param, +#else static void icmp_push_reply(struct icmp_bxm *icmp_param, +#endif struct flowi4 *fl4, struct ipcm_cookie *ipc, struct rtable **rt) { @@ -465,7 +478,11 @@ local_bh_enable(); } +#if defined(CONFIG_BCM_KF_MAP) && IS_ENABLED(CONFIG_BCM_MAP) +struct rtable *icmp_route_lookup(struct net *net, +#else static struct rtable *icmp_route_lookup(struct net *net, +#endif struct flowi4 *fl4, struct sk_buff *skb_in, const struct iphdr *iph, @@ -487,7 +504,11 @@ fl4->flowi4_proto = IPPROTO_ICMP; fl4->fl4_icmp_type = type; fl4->fl4_icmp_code = code; +#if defined(CONFIG_BCM_KF_MAP) && IS_ENABLED(CONFIG_BCM_MAP) + fl4->flowi4_oif = l3mdev_master_ifindex(skb_dst(skb_in) ? skb_dst(skb_in)->dev : NULL); +#else fl4->flowi4_oif = l3mdev_master_ifindex(skb_dst(skb_in)->dev); +#endif security_skb_classify_flow(skb_in, flowi4_to_flowi(fl4)); rt = ip_route_output_key_hash(net, fl4, skb_in); @@ -511,7 +532,11 @@ if (err) goto relookup_failed; +#if defined(CONFIG_BCM_KF_MAP) && IS_ENABLED(CONFIG_BCM_MAP) + if (inet_addr_type_dev_table(net, skb_dst(skb_in) ? skb_dst(skb_in)->dev : NULL, +#else if (inet_addr_type_dev_table(net, skb_dst(skb_in)->dev, +#endif fl4_dec.saddr) == RTN_LOCAL) { rt2 = __ip_route_output_key(net, &fl4_dec); if (IS_ERR(rt2)) @@ -1107,6 +1132,8 @@ } } + avm_pa_add_local_session(AVM_PA_NET_IP_DEVINFO(dev_net(skb->dev)), skb, NULL); + success = icmp_pointers[icmph->type].handler(skb); if (success) { @@ -1151,7 +1178,11 @@ /* * This table is the definition of how we handle ICMP. */ +#if defined(CONFIG_BCM_KF_MAP) && IS_ENABLED(CONFIG_BCM_MAP) +const struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = { +#else static const struct icmp_control icmp_pointers[NR_ICMP_TYPES + 1] = { +#endif [ICMP_ECHOREPLY] = { .handler = ping_rcv, },