From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH 1/3] netlink: Remove redundant check on nlmsg_type
Date: Tue, 15 Aug 2023 13:51:27 +1000 [thread overview]
Message-ID: <20230815035129.1942905-2-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20230815035129.1942905-1-david@gibson.dropbear.id.au>
In the loop within nl_addr_dup() we check and skip for any messages that
aren't of type RTM_NEWADDR. This is a leftover that was missed in the
recent big netlink cleanup. In fact we already check for the message type
in the nl_foreach_oftype() macro, so the explicit test is redudant.
Remove it.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
netlink.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/netlink.c b/netlink.c
index 1226379..ff44e13 100644
--- a/netlink.c
+++ b/netlink.c
@@ -669,9 +669,6 @@ int nl_addr_dup(int s_src, unsigned int ifi_src,
struct rtattr *rta;
size_t na;
- if (nh->nlmsg_type != RTM_NEWADDR)
- continue;
-
ifa = (struct ifaddrmsg *)NLMSG_DATA(nh);
if (rc < 0 || ifa->ifa_scope == RT_SCOPE_LINK ||
--
@@ -669,9 +669,6 @@ int nl_addr_dup(int s_src, unsigned int ifi_src,
struct rtattr *rta;
size_t na;
- if (nh->nlmsg_type != RTM_NEWADDR)
- continue;
-
ifa = (struct ifaddrmsg *)NLMSG_DATA(nh);
if (rc < 0 || ifa->ifa_scope == RT_SCOPE_LINK ||
--
2.41.0
next prev parent reply other threads:[~2023-08-15 3:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 3:51 [PATCH 0/3] pasta: Don't propagate host address lifetimes to the container David Gibson
2023-08-15 3:51 ` David Gibson [this message]
2023-08-15 3:51 ` [PATCH 2/3] netlink: Correctly calculate attribute length for address messages David Gibson
2023-08-15 3:51 ` [PATCH 3/3] netlink: Don't propagate host address expiry to the container David Gibson
2023-08-16 16:41 ` [PATCH 0/3] pasta: Don't propagate host address lifetimes " Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230815035129.1942905-2-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).