From 92e6b1a0e83cbfeeb1d29bbe2b8c71e212f885fd Mon Sep 17 00:00:00 2001 From: Andreas Scheuring Date: Wed, 26 Apr 2017 13:40:42 +0200 Subject: [PATCH] default gateway regex: use exact match for iface name If the current interface has a default gateway configured is determined by the regex default.+ If for example 'enc1' is used, but also an interface 'enc1800' is present, the regex will also match the 'enc1800' default gateway. This patch fixes this by looking for . This way 'enc1800' is not matched. Change-Id: Id1d58f5be6296c3a37aef788359ae8fe0fe11d8b --- lib/neutron-legacy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/neutron-legacy b/lib/neutron-legacy index 1dfd5fec7d..a409164386 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -570,7 +570,7 @@ function _move_neutron_addresses_route { local IP_DEL="" local IP_UP="" local DEFAULT_ROUTE_GW - DEFAULT_ROUTE_GW=$(ip -f $af r | awk "/default.+$from_intf/ { print \$3; exit }") + DEFAULT_ROUTE_GW=$(ip -f $af r | awk "/default.+$from_intf\s/ { print \$3; exit }") local ADD_OVS_PORT="" local DEL_OVS_PORT="" local ARP_CMD=""