← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1208689] Re: create a port error

 

I am afraid I cannot repro this on stable grizzly either, I am going to
mark this as invalid for now.

** Changed in: neutron
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1208689

Title:
  create a port  error

Status in OpenStack Neutron (virtual network service):
  Invalid

Bug description:
  Env: CentOS + Grizzly

  I create a subnet with ip 100.100.100.1/24. Then when I creat a port with ip 100.100.100.100, I will get the following error message:
  IP address 100.100.100.100 is not a valid IP for the defined subnet.

  When I use the subnet with ip 100.100.100.0/24, it can work well.
  I check the source of quantum, find that when it validate ip_address on subnet, it use the following code:
  quantum/db/db_base_plugin_v2.py
   526     @staticmethod
   527     def _check_subnet_ip(cidr, ip_address):
   528         """Validate that the IP address is on the subnet."""
   529         ip = netaddr.IPAddress(ip_address)
   530         net = netaddr.IPNetwork(cidr)
   531         # Check that the IP is valid on subnet. This cannot be the
   532         # network or the broadcast address
   533         if (ip != net.network and
   534                 ip != net.broadcast and
   535                 net.netmask & ip == net.ip):
   536             return True
   537         return False

  
  It should be 
   534                 ip != net.broadcast and
   535                 net.netmask & ip == net.ip & net.netmask ):

  Or,
  We should validate the input when we create subnet,  for example, 100.100.100.1/24 should be wrong.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1208689/+subscriptions