Comment 3 for bug 1382076

Revision history for this message
Sridhar Gaddam (sridhargaddam) wrote :

Neutron allocates the gateway_ip (if not specified) to the first IP address in the subnet CIDR and the gateway_ip is stored as part of subnet details.
So, by the time the request to attach the subnet gateway to the router is received, the gateway_ip is already allocated/reserved in the subnet.

For this particular Bug, there are two cases to consider...
1. When the gateway_ip is not specified as part of subnet creation.
2. Gateway_ip is specified and is part of subnet CIDR.

For the first case, IMO it would be ideal if Neutron does not reserve any gateway_ip address in create_subnet and allocate (based on EUI-64 addressing - as MAC address is allocated only during port creation) it only when the request to attach to the router interface is seen.
On the other hand, if the user creates the subnet with gateway_ip which is part of subnet CIDR, we can modify Neutron to check the port owner and if it happens to be the router, accept it.

I'm planning to submit a patch with this change and would like to hear the comments. Thanks.