]> www.infradead.org Git - users/hch/misc.git/commit
ipv4: Factorise RTM_NEWADDR validation to inet_validate_rtm().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Mon, 21 Oct 2024 18:32:30 +0000 (11:32 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 29 Oct 2024 10:54:57 +0000 (11:54 +0100)
commit2d34429d14f9d09b38a8bee6a972a07228378df6
treeae708096cc63b2482344eae1b2566b5e7bf4e7a4
parent26d8db55eeacb7dc78672523f57825916d203de4
ipv4: Factorise RTM_NEWADDR validation to inet_validate_rtm().

rtm_to_ifaddr() validates some attributes, looks up a netdev,
allocates struct in_ifaddr, and validates IFA_CACHEINFO.

There is no reason to delay IFA_CACHEINFO validation.

We will push RTNL down to inet_rtm_newaddr(), and then we want
to complete rtnetlink validation before rtnl_net_lock().

Let's factorise the validation parts.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ipv4/devinet.c