render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
a54075
From ed1efa32c71ba195a16bb63da4ee532d8a6c8a99 Mon Sep 17 00:00:00 2001
a54075
From: Laine Stump <laine@laine.org>
a54075
Date: Mon, 15 Sep 2014 13:30:08 -0400
a54075
Subject: [PATCH] network: detect conflicting route even if it is the final
a54075
 entry
a54075
a54075
This is a folloup to commit 5f719596, which checks for a route
a54075
conflicting with the standard libvirt default network subnet
a54075
(192.168.122.0/24). It turns out that $() strips the trailing newline
a54075
from the output of "ip route show", so there would be no match if the
a54075
route we were looking for was the final line of output. This can be
a54075
solved by adding ${nl} to the end of the output (just as we were
a54075
already adding it at the beginning of the output).
a54075
a54075
(cherry picked from commit 22048ae61dbb7876d17bcf7dbedf9e8d1cf98d4e)
a54075
---
a54075
 libvirt.spec.in | 2 +-
a54075
 1 file changed, 1 insertion(+), 1 deletion(-)
a54075
a54075
diff --git a/libvirt.spec.in b/libvirt.spec.in
a54075
index 75a91f5..0741c73 100644
a54075
--- a/libvirt.spec.in
a54075
+++ b/libvirt.spec.in
a54075
@@ -1741,7 +1741,7 @@ if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ;
a54075
     sub=${orig_sub}
a54075
     nl='
a54075
 '
a54075
-    routes="${nl}$(ip route show | cut -d' ' -f1)"
a54075
+    routes="${nl}$(ip route show | cut -d' ' -f1)${nl}"
a54075
     case ${routes} in
a54075
       *"${nl}192.168.${orig_sub}.0/24${nl}"*)
a54075
         # there was a match, so we need to look for an unused subnet