Thread (12 messages) 12 messages, 4 authors, 2023-02-11

Re: [PATCH net-next 3/4] bridge: mcast: Move validation to a policy

From: Ido Schimmel <idosch@nvidia.com>
Date: 2023-02-11 15:46:16
Also in: bridge
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

On Fri, Feb 10, 2023 at 07:20:57PM -0800, Jakub Kicinski wrote:
On Thu,  9 Feb 2023 09:18:51 +0200 Ido Schimmel wrote:
quoted
+	if (nla_len(attr) != sizeof(struct br_mdb_entry)) {
+		NL_SET_ERR_MSG_MOD(extack, "Invalid MDBA_SET_ENTRY attribute length");
+		return -EINVAL;
Well, you're just moving it, but NL_SET_ERR_MSG_ATTR() would be better.
We shouldn't be adding _MOD() in the core implementation of the family.
Assuming you are referring to this code when it's moved to
net/core/rtnetlink.c, then I already removed the _MOD() suffix from it
(as visible in the RFC). I can squash this as well:
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index c9f878a28d32..491e4231b3dd 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -6138,7 +6138,7 @@ static int rtnl_validate_mdb_entry(const struct nlattr *attr,
        struct br_mdb_entry *entry = nla_data(attr);
 
        if (nla_len(attr) != sizeof(struct br_mdb_entry)) {
-               NL_SET_ERR_MSG(extack, "Invalid MDBA_SET_ENTRY attribute length");
+               NL_SET_ERR_MSG_ATTR(extack, attr, "Invalid attribute length");
                return -EINVAL;
        }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help