]> www.infradead.org Git - users/hch/misc.git/commit
mptcp: pm: userspace: use GENL_REQ_ATTR_CHECK
authorGeliang Tang <tanggeliang@kylinos.cn>
Fri, 7 Feb 2025 13:59:23 +0000 (14:59 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 11 Feb 2025 11:46:37 +0000 (12:46 +0100)
commit07bfabf8407b4c4cc010e0c41feeebed75594bd0
tree835df25056c9b61d5774c68ed91791b98c144ec4
parentb2bdec19beecf9351ff9f7ca3131f5f61aacfc9d
mptcp: pm: userspace: use GENL_REQ_ATTR_CHECK

A more general way to check if MPTCP_PM_ATTR_* exists in 'info'
is to use GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_*) instead of
directly reading info->attrs[MPTCP_PM_ATTR_*] and then checking
if it's NULL.

So this patch uses GENL_REQ_ATTR_CHECK() for userspace PM in
mptcp_pm_nl_announce_doit(), mptcp_pm_nl_remove_doit(),
mptcp_pm_nl_subflow_create_doit(), mptcp_pm_nl_subflow_destroy_doit()
and mptcp_userspace_pm_get_sock().

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/mptcp/pm_userspace.c