ipv6: Move lifetime validation to inet6_rtm_newaddr().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 15 Jan 2025 08:06:06 +0000 (17:06 +0900)
committerJakub Kicinski <kuba@kernel.org>
Mon, 20 Jan 2025 20:16:05 +0000 (12:16 -0800)
commit867b385251eac666685f7f4132315a1e3619baa5
treebb19eed1c9ff3fda780e7769825c6f9a6f7350fb
parent2f1ace4127fdfc102603f359756b230f3d897411
ipv6: Move lifetime validation to inet6_rtm_newaddr().

inet6_addr_add() and inet6_addr_modify() have the same code to validate
IPv6 lifetime that is done under RTNL.

Let's factorise it out to inet6_rtm_newaddr() so that we can validate
the lifetime without RTNL later.

Note that inet6_addr_add() is called from addrconf_add_ifaddr(), but the
lifetime is INFINITY_LIFE_TIME in the path, so expires and flags are 0.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250115080608.28127-10-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/addrconf.c