// SPDX-License-Identifier: GPL-2.0-or-later/* * Internet Control Message Protocol (ICMPv6) * Linux INET6 implementation * * Authors: * Pedro Roque <roque@di.fc.ul.pt> * * Based on net/ipv4/icmp.c * * RFC 1885 *//* * Changes: * * Andi Kleen : exception handling * Andi Kleen add rate limits. never reply to a icmp. * add more length checks and other fixes. * yoshfuji : ensure to sent parameter problem for * fragments. * YOSHIFUJI Hideaki @USAGI: added sysctl for icmp rate limit. * Randy Dunlap and * YOSHIFUJI Hideaki @USAGI: Per-interface statistics support * Kazunori MIYAZAWA @USAGI: change output process to use ip6_append_data */#define pr_fmt(fmt) "IPv6: " fmt#include<linux/module.h>#include<linux/errno.h>#include<linux/types.h>#include<linux/socket.h>#include<linux/in.h>#include<linux/kernel.h>#include<linux/sockios.h>#include<linux/net.h>#include<linux/skbuff.h>#include<linux/init.h>#include<linux/netfilter.h>#include<linux/slab.h>#ifdef CONFIG_SYSCTL#include<linux/sysctl.h>#endif#include<linux/inet.h>#include<linux/netdevice.h>#include<linux/icmpv6.h>#include<net/ip.h>#include<net/sock.h>#include<net/ipv6.h>#include<net/ip6_checksum.h>#include<net/ping.h>#include<net/protocol.h>#include<net/raw.h>#include<net/rawv6.h>#include<net/seg6.h>#include<net/transp_v6.h>#include<net/ip6_route.h>#include<net/addrconf.h>#include<net/icmp.h>#include<net/xfrm.h>#include<net/inet_common.h>#include<net/dsfield.h>#include<net/l3mdev.h>#include<linux/uaccess.h>staticDEFINE_PER_CPU(structsock*,ipv6_icmp_sk);staticinticmpv6_err(structsk_buff*skb,structinet6_skb_parm