kernel_samsung_a53x/net
Patrick Rohr f7ec824ac0 net: change accept_ra_min_rtr_lft to affect all RA lifetimes
commit 5027d54a9c30bc7ec808360378e2b4753f053f25 upstream.

accept_ra_min_rtr_lft only considered the lifetime of the default route
and discarded entire RAs accordingly.

This change renames accept_ra_min_rtr_lft to accept_ra_min_lft, and
applies the value to individual RA sections; in particular, router
lifetime, PIO preferred lifetime, and RIO lifetime. If any of those
lifetimes are lower than the configured value, the specific RA section
is ignored.

In order for the sysctl to be useful to Android, it should really apply
to all lifetimes in the RA, since that is what determines the minimum
frequency at which RAs must be processed by the kernel. Android uses
hardware offloads to drop RAs for a fraction of the minimum of all
lifetimes present in the RA (some networks have very frequent RAs (5s)
with high lifetimes (2h)). Despite this, we have encountered networks
that set the router lifetime to 30s which results in very frequent CPU
wakeups. Instead of disabling IPv6 (and dropping IPv6 ethertype in the
WiFi firmware) entirely on such networks, it seems better to ignore the
misconfigured routers while still processing RAs from other IPv6 routers
on the same network (i.e. to support IoT applications).

The previous implementation dropped the entire RA based on router
lifetime. This turned out to be hard to expand to the other lifetimes
present in the RA in a consistent manner; dropping the entire RA based
on RIO/PIO lifetimes would essentially require parsing the whole thing
twice.

Fixes: 1671bcfd76fd ("net: add sysctl accept_ra_min_rtr_lft")
Cc: Lorenzo Colitti <lorenzo@google.com>
Signed-off-by: Patrick Rohr <prohr@google.com>
Reviewed-by: Maciej Żenczykowski <maze@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20230726230701.919212-1-prohr@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-08 11:25:47 +01:00
..
6lowpan Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
9p Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
802 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
8021q Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
appletalk Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ax25 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
batman-adv Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bluetooth Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bpf Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bpfilter Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bridge Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
caif Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
can Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ceph Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
core Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
dcb Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dccp Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
decnet Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dns_resolver Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dsa Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
ethernet Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
ethtool Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hsr Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ieee802154 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ife Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ipv4 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ipv6 net: change accept_ra_min_rtr_lft to affect all RA lifetimes 2024-11-08 11:25:47 +01:00
iucv Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kcm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
key Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
l2tp Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
l3mdev Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lapb Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
llc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mac80211 Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
mac802154 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mpls Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mptcp Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ncm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ncsi Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netfilter net: prevent address rewrite in kernel_bind() 2024-11-08 11:25:44 +01:00
netlabel Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netlink Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netrom Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfc nfc: nci: assert requested protocol is valid 2024-11-08 11:25:46 +01:00
nsh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
openvswitch Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
packet Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
phonet Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
psample Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qrtr Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rds net: prevent address rewrite in kernel_bind() 2024-11-08 11:25:44 +01:00
rfkill Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rose Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rxrpc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sched Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sctp Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
skb_tracer Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
strparser Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sunrpc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
switchdev Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tipc Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tls Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
unix Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vmw_vsock Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wimax Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wireless net: reg: Unlock all channels 2024-06-15 16:29:21 -03:00
x25 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xdp Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xfrm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
compat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
devres.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
socket.c net: prevent address rewrite in kernel_bind() 2024-11-08 11:25:44 +01:00
sysctl_net.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
TEST_MAPPING Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00