[PATCH] Force interface up before checking link status (#525071).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 isys/linkdetect.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/isys/linkdetect.c b/isys/linkdetect.c
index cffdd89..f97a291 100644
--- a/isys/linkdetect.c
+++ b/isys/linkdetect.c
@@ -143,6 +143,20 @@ int get_link_status(char * devname) {
         return -1;
     }
 
+    /* make sure interface is up and activated */
+    memset(&ifr, 0, sizeof(ifr));
+    strcpy(ifr.ifr_name, devname);
+
+    if (ioctl(sock, SIOCGIFFLAGS, &ifr) < 0) {
+        return -1;
+    }
+
+    ifr.ifr_flags |= (IFF_UP | IFF_RUNNING);
+
+    if (ioctl(sock, SIOCSIFFLAGS, &ifr) < 0) {
+        return -1;
+    }
+
     /* Setup our control structures. */
     memset(&ifr, 0, sizeof(ifr));
     strcpy(ifr.ifr_name, devname);
-- 
1.6.2.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux