summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2007-03-27 21:23:50 +0000
committerDavid Cantrell <dcantrell@redhat.com>2007-03-27 21:23:50 +0000
commite76920a9cdc35018c693c24c684cba81dfa4cafa (patch)
tree0623dcbf1eff71b7efa29b77a8695553ed7270b3 /isys
parent487dca5284caa220a9647bb80780921a37583d2b (diff)
downloadanaconda-e76920a9cdc35018c693c24c684cba81dfa4cafa.tar.gz
anaconda-e76920a9cdc35018c693c24c684cba81dfa4cafa.tar.xz
anaconda-e76920a9cdc35018c693c24c684cba81dfa4cafa.zip
* gui.py (releaseNotesButtonClicked): Spaces vs. tabs, tonight at 11.
* network.py (hasActiveDev): Use isys.getLinkStatus() rather than isys.getIPAddress() (#232512). * isys/isys.c (doGetIPAddress): Do not clear netlink cache. * isys/nl.c: Netlink cache searching cleanups.
Diffstat (limited to 'isys')
-rw-r--r--isys/isys.c5
-rw-r--r--isys/nl.c14
2 files changed, 10 insertions, 9 deletions
diff --git a/isys/isys.c b/isys/isys.c
index abba8e25d..9b6549d3f 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -1130,11 +1130,6 @@ static PyObject * doGetIPAddress(PyObject * s, PyObject * args) {
if (!PyArg_ParseTuple(args, "s", &dev))
return NULL;
- /* We might have a cached list of interfaces without IP address
- * information, so clear it out here to reinit.
- */
- netlink_interfaces_list_free();
-
ret = netlink_interfaces_ip2str(dev);
return Py_BuildValue("s", ret);
diff --git a/isys/nl.c b/isys/nl.c
index 2702a98af..9fc8bb71d 100644
--- a/isys/nl.c
+++ b/isys/nl.c
@@ -188,7 +188,7 @@ int netlink_get_interface_ip(int index, int family, void *addr) {
memset(buf, 0, sizeof(buf));
ret = recvfrom(sock, buf, sizeof(buf), 0, NULL, 0);
if (ret < 0) {
- perror("recvfrom in netlink_init_interfaces_table");
+ perror("recvfrom in netlink_get_interface_ip");
close(sock);
return -1;
}
@@ -266,6 +266,10 @@ int netlink_init_interfaces_list(void) {
struct rtattr *tb[IFLA_MAX+1];
interface_info_t *intfinfo;
+ /* if interfaces has stuff, free it now and read again */
+ if (interfaces != NULL)
+ netlink_interfaces_list_free();
+
/* get a socket */
if ((sock = netlink_create_socket()) == -1) {
perror("netlink_create_socket in netlink_init_interfaces_list");
@@ -412,14 +416,16 @@ char *netlink_interfaces_ip2str(char *ifname) {
if (ifname == NULL)
return NULL;
- /* init the interfaces list if it's empty */
- if (interfaces == NULL) {
+ /* init the interfaces list if it's empty or if nothing is found */
+ e = g_slist_find_custom(interfaces,ifname,&_netlink_interfaces_elem_find);
+ if (interfaces == NULL || e == NULL) {
if (netlink_init_interfaces_list() == -1) {
- perror("netlink_init_interfaces_list in netlink_interface_mac2str");
+ perror("netlink_init_interfaces_list in netlink_interface_ip2str");
return NULL;
}
}
+ /* search */
e = g_slist_find_custom(interfaces,ifname,&_netlink_interfaces_elem_find);
if (e == NULL) {
return NULL;