linux/net
Ido Schimmel d12d04d221 ipv6: icmp: Add RFC 5837 support
Add the ability to append the incoming IP interface information to
ICMPv6 error messages in accordance with RFC 5837 and RFC 4884. This is
required for more meaningful traceroute results in unnumbered networks.

The feature is disabled by default and controlled via a new sysctl
("net.ipv6.icmp.errors_extension_mask") which accepts a bitmask of ICMP
extensions to append to ICMP error messages. Currently, only a single
value is supported, but the interface and the implementation should be
able to support more extensions, if needed.

Clone the skb and copy the relevant data portions before modifying the
skb as the caller of icmp6_send() still owns the skb after the function
returns. This should be fine since by default ICMP error messages are
rate limited to 1000 per second and no more than 1 per second per
specific host.

Trim or pad the packet to 128 bytes before appending the ICMP extension
structure in order to be compatible with legacy applications that assume
that the ICMP extension structure always starts at this offset (the
minimum length specified by RFC 4884).

Since commit 20e1954fe2 ("ipv6: RFC 4884 partial support for SIT/GRE
tunnels") it is possible for icmp6_send() to be called with an skb that
already contains ICMP extensions. This can happen when we receive an
ICMPv4 message with extensions from a tunnel and translate it to an
ICMPv6 message towards an IPv6 host in the overlay network. I could not
find an RFC that supports this behavior, but it makes sense to not
overwrite the original extensions that were appended to the packet.
Therefore, avoid appending extensions if the length field in the
provided ICMPv6 header is already filled.

Export netdev_copy_name() using EXPORT_IPV6_MOD_GPL() to make it
available to IPv6 when it is built as a module.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20251027082232.232571-3-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-29 18:28:30 -07:00
..
6lowpan
9p 9p/trans_fd: p9_fd_request: kick rx thread if EPOLLIN 2025-09-19 16:34:51 +09:00
802
8021q
appletalk
atm neighbour: Convert rwlock of struct neigh_table to spinlock. 2025-10-24 17:57:20 -07:00
ax25 ax25: properly unshare skbs in ax25_kiss_rcv() 2025-09-03 17:06:30 -07:00
batman-adv batman-adv: use skb_crc32c() instead of skb_seq_read() 2025-10-17 16:30:43 +02:00
bluetooth Bluetooth: Avoid a couple dozen -Wflex-array-member-not-at-end warnings 2025-09-27 11:37:43 -04:00
bpf bpf: Do not disable preemption in bpf_test_run(). 2025-10-17 11:29:35 -07:00
bridge net: bridge: Flush multicast groups when snooping is disabled 2025-10-27 17:57:21 -07:00
caif caif: Replace memset(0) + strscpy() with strscpy_pad() 2025-08-12 14:08:56 -07:00
can can: j1939: add missing calls in NETDEV_UNREGISTER notification handler 2025-10-13 21:26:31 +02:00
ceph Some messenger improvements from Eric and Max, a patch to address the 2025-10-10 11:30:19 -07:00
core ipv6: icmp: Add RFC 5837 support 2025-10-29 18:28:30 -07:00
dcb Revert "Documentation: net: add flow control guide and document ethtool API" 2025-10-01 09:48:21 +02:00
devlink devlink: region: correct port region lookup to use port_ops 2025-10-21 17:40:26 -07:00
dns_resolver
dsa net: dsa: tag_yt921x: add support for Motorcomm YT921x tags 2025-10-21 18:25:30 -07:00
ethernet ethernet: Extend device_get_mac_address() to use NVMEM 2025-09-15 18:34:08 -07:00
ethtool Revert "Documentation: net: add flow control guide and document ethtool API" 2025-10-01 09:48:21 +02:00
handshake
hsr Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-10-23 10:53:08 -07:00
ieee802154
ife
ipv4 ipv4: icmp: Add RFC 5837 support 2025-10-29 18:28:29 -07:00
ipv6 ipv6: icmp: Add RFC 5837 support 2025-10-29 18:28:30 -07:00
iucv s390/iucv: Convert sprintf/snprintf to scnprintf 2025-10-20 18:35:21 -07:00
kcm net: kcm: Fix race condition in kcm_unattach() 2025-08-13 18:18:33 -07:00
key
l2tp l2tp: do not use sock_hold() in pppol2tp_session_get_sock() 2025-08-27 17:16:13 -07:00
l3mdev
lapb
llc
mac80211 wifi: mac80211: fix Rx packet handling when pubsta information is not available 2025-09-19 11:59:34 +02:00
mac802154
mctp net: mctp: fix typo in comment 2025-09-08 17:47:57 -07:00
mpls
mptcp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-10-23 10:53:08 -07:00
ncsi
netfilter netfilter: nft_objref: validate objref and objrefmap expressions 2025-10-08 13:17:25 +02:00
netlabel audit: add record for multiple task security contexts 2025-08-30 10:15:30 -04:00
netlink net: remove obsolete WARN_ON(refcount_read(&sk->sk_refcnt) == 1) 2025-10-15 17:18:38 -07:00
netrom
nfc net: nfc: nci: Add parameter validation for packet data 2025-09-30 10:27:14 +02:00
nsh
openvswitch net: replace use of system_wq with system_percpu_wq 2025-09-22 17:40:30 -07:00
packet net: af_packet: Use hrtimer to do the retire operation 2025-09-11 18:40:06 -07:00
phonet net: add sk_drops_read(), sk_drops_inc() and sk_drops_reset() helpers 2025-08-28 13:14:50 +02:00
psample
psp net: psp: don't assume reply skbs will have a socket 2025-10-03 10:23:50 -07:00
qrtr
rds net: WQ_PERCPU added to alloc_workqueue users 2025-09-22 17:40:30 -07:00
rfkill net: replace use of system_wq with system_percpu_wq 2025-09-22 17:40:30 -07:00
rose net: rose: fix a typo in rose_clear_routes() 2025-08-27 17:27:52 -07:00
rxrpc net: WQ_PERCPU added to alloc_workqueue users 2025-09-22 17:40:30 -07:00
sched net: sched: Don't use WARN_ON_ONCE() for -ENOMEM in tcf_classify(). 2025-10-29 18:00:37 -07:00
sctp sctp: Constify struct sctp_sched_ops 2025-10-28 17:50:55 -07:00
shaper
smc smc: rename smc_find_ism_store_rc to reflect broader usage 2025-10-24 18:48:03 -07:00
strparser strparser: fix typo in comment 2025-10-24 18:47:08 -07:00
sunrpc NFSD 6.18 Release Notes 2025-10-06 13:22:21 -07:00
switchdev
tipc net: remove obsolete WARN_ON(refcount_read(&sk->sk_refcnt) == 1) 2025-10-15 17:18:38 -07:00
tls net/tls: support setting the maximum payload size 2025-10-27 16:13:42 -07:00
unix net: unix: remove outdated BSD behavior comment in unix_release_sock() 2025-10-23 17:26:16 -07:00
vmw_vsock vsock: fix lock inversion in vsock_assign_transport() 2025-10-23 16:07:58 +02:00
wireless wifi: cfg80211: fix width unit in cfg80211_radio_chandef_valid() 2025-09-23 09:50:02 +02:00
x25
xdp xsk: Harden userspace-supplied xdp_desc validation 2025-10-10 10:07:48 -07:00
xfrm espintcp: use datagram_poll_queue for socket readiness 2025-10-23 15:46:04 +02:00
Kconfig net: Kconfig: discourage drop_monitor enablement 2025-10-17 16:29:26 -07:00
Kconfig.debug
Makefile psp: base PSP device support 2025-09-18 12:32:06 +02:00
compat.c
devres.c
socket.c Networking changes for 6.18. 2025-10-02 15:17:01 -07:00
sysctl_net.c