[PATCH] network.dracutSetupString(): handle hosts outside the subnet (#577193)

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

 



Out "ip route" output parsing did not handle the "ip route" output
properly in the case we were trying to find out which interface is
used to get to a host when that host lives outside our subnet.

This patch fixes this. Note this only fixes part of #577193, but as
the other part is really unrelated I'm splitting the fix into 2
patches.
---
 network.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/network.py b/network.py
index a3fb8ee..f992d18 100644
--- a/network.py
+++ b/network.py
@@ -786,12 +786,13 @@ class Network:
                 return ""
 
             routeInfo = route.split()
-            if routeInfo[0] != host or len(routeInfo) < 5:
+            if routeInfo[0] != host or len(routeInfo) < 5 or \
+               "dev" not in routeInfo or routeInfo.index("dev") > 3:
                 log.error('Unexpected "ip route get to %s" reply: %s' %
                           (host, routeInfo))
                 return ""
 
-            nic = routeInfo[2]
+            nic = routeInfo[routeInfo.index("dev") + 1]
 
         if nic not in self.netdevices.keys():
             log.error('Unknown network interface: %s' % nic)
-- 
1.7.0.1

_______________________________________________
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