linux/net/psp
Eric Dumazet c26b8c4e29 net: fix off-by-one in udp_flow_src_port() / psp_write_headers()
udp_flow_src_port() and psp_write_headers() use ip_local_port_range.

ip_local_port_range is inclusive : all ports between min and max
can be used.

Before this patch, if ip_local_port_range was set to 40000-40001
40001 would not be used as a source port.

Use reciprocal_scale() to help code readability.

Not tagged for stable trees, as this change could break user
expectations.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260302163933.1754393-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-03-04 16:51:10 -08:00
..
Kconfig net: psp: select CONFIG_SKB_EXTENSIONS 2026-02-17 17:05:29 -08:00
Makefile net: psp: add socket security association code 2025-09-18 12:32:06 +02:00
psp_main.c net: fix off-by-one in udp_flow_src_port() / psp_write_headers() 2026-03-04 16:51:10 -08:00
psp_nl.c psp: add stats from psp spec to driver facing api 2025-11-07 18:53:57 -08:00
psp_sock.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
psp-nl-gen.c tools: ynl-gen: add regeneration comment 2025-11-25 19:20:42 -08:00
psp-nl-gen.h tools: ynl-gen: add regeneration comment 2025-11-25 19:20:42 -08:00
psp.h psp: rename our psp_dev_destroy() 2025-09-18 07:04:25 -07:00