Choose first running interface, rather than first "up" interface (Redhat #1403025)
Robert Scheck <robert@fedoraproject.org>
This commit is contained in:
@@ -6,6 +6,9 @@ Unattributed items are by Paul Warren and Chris Lightfoot.
|
|||||||
|
|
||||||
1.0
|
1.0
|
||||||
|
|
||||||
|
* Choose first running interface, rather than first "up" interface (Redhat #1403025)
|
||||||
|
Robert Scheck <robert@fedoraproject.org>
|
||||||
|
|
||||||
* Support for unlimited number of lines of output for text mode
|
* Support for unlimited number of lines of output for text mode
|
||||||
Roman Hoog Antink <rha@open.ch>
|
Roman Hoog Antink <rha@open.ch>
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ static char *get_first_interface(void) {
|
|||||||
while(nameindex[j].if_index != 0) {
|
while(nameindex[j].if_index != 0) {
|
||||||
if (strcmp(nameindex[j].if_name, "lo") != 0 && !is_bad_interface_name(nameindex[j].if_name)) {
|
if (strcmp(nameindex[j].if_name, "lo") != 0 && !is_bad_interface_name(nameindex[j].if_name)) {
|
||||||
strncpy(ifr.ifr_name, nameindex[j].if_name, sizeof(ifr.ifr_name));
|
strncpy(ifr.ifr_name, nameindex[j].if_name, sizeof(ifr.ifr_name));
|
||||||
if ((s == -1) || (ioctl(s, SIOCGIFFLAGS, &ifr) == -1) || (ifr.ifr_flags & IFF_UP)) {
|
if ((s == -1) || (ioctl(s, SIOCGIFFLAGS, &ifr) == -1) || (ifr.ifr_flags & IFF_RUNNING)) {
|
||||||
i = xstrdup(nameindex[j].if_name);
|
i = xstrdup(nameindex[j].if_name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user