[libvirt] [PATCH] util: make forgotten changes suggested during review of commit d40b820c

Laine Stump posted 1 patch 5 years, 3 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190113054220.14200-1-laine@laine.org
src/util/virnetdevip.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
[libvirt] [PATCH] util: make forgotten changes suggested during review of commit d40b820c
Posted by Laine Stump 5 years, 3 months ago
I had intended to make these changes to commit d40b820c before
pushing, but forgot about it during the day between the initial review
and ACK.

Neither change is significant - just returning immediately when
virNetDevGetName() faills (instead of logging a debug message first)
and eliminating a comment that adds to confusion rather than
eliminating it. Still, the changes should be made to be more consistent with nearly identical code just a few lines up (added in commit 7282f455)

Signed-off-by: Laine Stump <laine@laine.org>
---
 src/util/virnetdevip.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c
index 8c960ceeac..b6df422cd1 100644
--- a/src/util/virnetdevip.c
+++ b/src/util/virnetdevip.c
@@ -584,18 +584,18 @@ virNetDevIPCheckIPv6ForwardingCallback(struct nlmsghdr *resp,
 
             ifname = virNetDevGetName(nh->rtnh_ifindex);
 
-            if (ifname)
-                accept_ra = virNetDevIPGetAcceptRA(ifname);
+            if (!ifname)
+                return -1;
+
+            accept_ra = virNetDevIPGetAcceptRA(ifname);
 
             VIR_DEBUG("Checking multipath route nexthop device %s (%d), accept_ra: %d",
                       ifname, nh->rtnh_ifindex, accept_ra);
 
-            if (!ifname ||
-                (accept_ra != 2 && virNetDevIPCheckIPv6ForwardingAddIF(data, &ifname) < 0)) {
+            if (accept_ra != 2 && virNetDevIPCheckIPv6ForwardingAddIF(data, &ifname) < 0)
                 return -1;
-            }
 
-            VIR_FREE(ifname); /* in case it wasn't added to the array */
+            VIR_FREE(ifname);
             data->hasRARoutes = true;
 
             len -= NLMSG_ALIGN(nh->rtnh_len);
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] util: make forgotten changes suggested during review of commit d40b820c
Posted by Ján Tomko 5 years, 3 months ago
On Sun, Jan 13, 2019 at 12:42:20AM -0500, Laine Stump wrote:
>I had intended to make these changes to commit d40b820c before
>pushing, but forgot about it during the day between the initial review
>and ACK.
>
>Neither change is significant - just returning immediately when
>virNetDevGetName() faills (instead of logging a debug message first)

*fails

>and eliminating a comment that adds to confusion rather than
>eliminating it. Still, the changes should be made to be more consistent with nearly identical code just a few lines up (added in commit 7282f455)

Please wrap this long line.

>
>Signed-off-by: Laine Stump <laine@laine.org>
>---
> src/util/virnetdevip.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list