summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2008-02-04 10:50:06 -1000
committerDavid Cantrell <dcantrell@redhat.com>2008-02-04 10:50:06 -1000
commit90f1447d542c6575b58edb6d17a3d946dbebace0 (patch)
tree9a0f38a118b9307364bcbeda034afd86365cfa2e /isys
parent3db06dee7802729ff373ab13f94ff78bfe50230a (diff)
downloadanaconda-90f1447d542c6575b58edb6d17a3d946dbebace0.tar.gz
anaconda-90f1447d542c6575b58edb6d17a3d946dbebace0.tar.xz
anaconda-90f1447d542c6575b58edb6d17a3d946dbebace0.zip
Avoid infinite loop in nl_ip2str().
Both continue statements would iterate over the same address again. Moved nl_cache_get_next() call to just be inside the expression for the while.
Diffstat (limited to 'isys')
-rw-r--r--isys/nl.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/isys/nl.c b/isys/nl.c
index 87178e594..7ebf91f6e 100644
--- a/isys/nl.c
+++ b/isys/nl.c
@@ -92,8 +92,7 @@ char *nl_ip2str(char *ifname) {
}
/* find the IPv4 and IPv6 addresses for this interface */
- obj = nl_cache_get_first(cache);
- while (obj) {
+ while ((obj = nl_cache_get_first(cache)) != NULL) {
raddr = (struct rtnl_addr *) obj;
if (rtnl_addr_get_ifindex(raddr) == ifindex) {
@@ -157,8 +156,6 @@ char *nl_ip2str(char *ifname) {
}
}
}
-
- obj = nl_cache_get_next(obj);
}
ip2str_error: