]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: make forgotten changes suggested during review of commit d40b820c
authorLaine Stump <laine@laine.org>
Sat, 12 Jan 2019 21:14:50 +0000 (16:14 -0500)
committerLaine Stump <laine@laine.org>
Mon, 14 Jan 2019 14:43:55 +0000 (09:43 -0500)
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() fails (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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virnetdevip.c

index 8c960ceeac24e32166d8c3891066800dc3775dbb..b6df422cd1d8dc7365378450a4f9b4e087915213 100644 (file)
@@ -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);