Fix interface IP address for DVR with gateway
when an interface is added to a router with gateway, the method internal_network_added(..) incorrectly configures the IP address of the new snat interface same as the IP address of the new subnet interface. Change-Id: I00d4ff1105a443b89b28359249b8e83fb4c1d157 Closes-bug: #1355087
This commit is contained in:
		@@ -1425,7 +1425,8 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, manager.Manager):
 | 
			
		||||
                          self.get_snat_int_device_name(sn_port['id']))
 | 
			
		||||
                    self._internal_network_added(ns_name,
 | 
			
		||||
                                                 sn_port['network_id'],
 | 
			
		||||
                                                 sn_port['id'], internal_cidr,
 | 
			
		||||
                                                 sn_port['id'],
 | 
			
		||||
                                                 sn_port['ip_cidr'],
 | 
			
		||||
                                                 sn_port['mac_address'],
 | 
			
		||||
                                                 interface_name,
 | 
			
		||||
                                                 SNAT_INT_DEV_PREFIX)
 | 
			
		||||
 
 | 
			
		||||
@@ -446,6 +446,14 @@ class TestBasicRouterOperations(base.BaseTestCase):
 | 
			
		||||
            self.assertEqual(agent._snat_redirect_add.call_count, 1)
 | 
			
		||||
            self.assertEqual(agent._set_subnet_info.call_count, 1)
 | 
			
		||||
            self.assertEqual(agent._internal_network_added.call_count, 2)
 | 
			
		||||
            agent._internal_network_added.assert_called_with(
 | 
			
		||||
                agent.get_snat_ns_name(ri.router['id']),
 | 
			
		||||
                sn_port['network_id'],
 | 
			
		||||
                sn_port['id'],
 | 
			
		||||
                sn_port['ip_cidr'],
 | 
			
		||||
                sn_port['mac_address'],
 | 
			
		||||
                agent.get_snat_int_device_name(sn_port['id']),
 | 
			
		||||
                l3_agent.SNAT_INT_DEV_PREFIX)
 | 
			
		||||
 | 
			
		||||
    def test_agent_add_internal_network(self):
 | 
			
		||||
        self._test_internal_network_action('add')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user