DVR: verify subnet has gateway_ip before installing IPv4 flow
If a user clears the gateway_ip of a subnet and the OVS
agent is re-started, it will throw an exception trying
to install the DVR IPv4 flow. Do not install the flow
in this case since it is not required.
Change-Id: I79aba63498aa9af1156e37530627fcaec853a740
Closes-bug: #1728665
(cherry picked from commit 9be7b62f77
)
This commit is contained in:
parent
215ad4ab5b
commit
f5e7420da5
|
@ -426,8 +426,9 @@ class OVSDVRNeutronAgent(object):
|
|||
# TODO(vivek) remove the IPv6 related flows once SNAT is not
|
||||
# used for IPv6 DVR.
|
||||
if ip_version == 4:
|
||||
br.install_dvr_process_ipv4(
|
||||
vlan_tag=lvm.vlan, gateway_ip=subnet_info['gateway_ip'])
|
||||
if subnet_info['gateway_ip']:
|
||||
br.install_dvr_process_ipv4(
|
||||
vlan_tag=lvm.vlan, gateway_ip=subnet_info['gateway_ip'])
|
||||
else:
|
||||
br.install_dvr_process_ipv6(
|
||||
vlan_tag=lvm.vlan, gateway_mac=subnet_info['gateway_mac'])
|
||||
|
@ -621,8 +622,10 @@ class OVSDVRNeutronAgent(object):
|
|||
if network_type in constants.TUNNEL_NETWORK_TYPES:
|
||||
br = self.tun_br
|
||||
if ip_version == 4:
|
||||
br.delete_dvr_process_ipv4(
|
||||
vlan_tag=lvm.vlan, gateway_ip=subnet_info['gateway_ip'])
|
||||
if subnet_info['gateway_ip']:
|
||||
br.delete_dvr_process_ipv4(
|
||||
vlan_tag=lvm.vlan,
|
||||
gateway_ip=subnet_info['gateway_ip'])
|
||||
else:
|
||||
br.delete_dvr_process_ipv6(
|
||||
vlan_tag=lvm.vlan, gateway_mac=subnet_info['gateway_mac'])
|
||||
|
|
Loading…
Reference in New Issue