Use IPv6_LLA_PREFIX from neutron-lib
Replace uses of IPV6_LLA_PREFIX from neutron.common.constants with IPv6_LLA_PREFIX from neutron-lib. Remove IPV6_LLA_PREFIX constant as it is no longer used in the code base: http://codesearch.openstack.org/?q=IPV6_LLA_PREFIX TrivialFix Change-Id: Ic81f63670cd51181b349c5c26cc49b2b654860f2
This commit is contained in:
parent
9e7298a75b
commit
fe5ef3654e
|
@ -29,7 +29,6 @@ from neutron.agent.linux import ipset_manager
|
|||
from neutron.agent.linux import iptables_comments as ic
|
||||
from neutron.agent.linux import iptables_manager
|
||||
from neutron.agent.linux import utils
|
||||
from neutron.common import constants as n_const
|
||||
from neutron.common import exceptions as n_exc
|
||||
from neutron.common import ipv6_utils
|
||||
from neutron.common import utils as c_utils
|
||||
|
@ -381,7 +380,7 @@ class IptablesFirewallDriver(firewall.FirewallDriver):
|
|||
else:
|
||||
mac_ipv6_pairs.append((mac, ip_address))
|
||||
lla = str(ipv6_utils.get_ipv6_addr_by_EUI64(
|
||||
n_const.IPV6_LLA_PREFIX, mac))
|
||||
constants.IPv6_LLA_PREFIX, mac))
|
||||
mac_ipv6_pairs.append((mac, lla))
|
||||
|
||||
def _spoofing_rule(self, port, ipv4_rules, ipv6_rules):
|
||||
|
|
|
@ -87,7 +87,7 @@ class OFPort(object):
|
|||
self.vlan_tag = vlan_tag
|
||||
self.mac = ovs_port.vif_mac
|
||||
self.lla_address = str(ipv6_utils.get_ipv6_addr_by_EUI64(
|
||||
constants.IPV6_LLA_PREFIX, self.mac))
|
||||
lib_const.IPv6_LLA_PREFIX, self.mac))
|
||||
self.ofport = ovs_port.ofport
|
||||
self.sec_groups = list()
|
||||
self.fixed_ips = port_dict.get('fixed_ips', [])
|
||||
|
|
|
@ -17,6 +17,7 @@ import functools
|
|||
import signal
|
||||
|
||||
import eventlet
|
||||
from neutron_lib import constants as n_const
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
@ -175,7 +176,7 @@ class PrefixDelegation(object):
|
|||
|
||||
@staticmethod
|
||||
def _get_lla(mac):
|
||||
lla = ipv6_utils.get_ipv6_addr_by_EUI64(l3_constants.IPV6_LLA_PREFIX,
|
||||
lla = ipv6_utils.get_ipv6_addr_by_EUI64(n_const.IPv6_LLA_PREFIX,
|
||||
mac)
|
||||
return lla
|
||||
|
||||
|
|
|
@ -72,8 +72,6 @@ DHCPV6_STATELESS = 'dhcpv6-stateless'
|
|||
IPV6_SLAAC = 'slaac'
|
||||
IPV6_MODES = [DHCPV6_STATEFUL, DHCPV6_STATELESS, IPV6_SLAAC]
|
||||
|
||||
IPV6_LLA_PREFIX = 'fe80::/64'
|
||||
|
||||
# Special provisional prefix for IPv6 Prefix Delegation
|
||||
PROVISIONAL_IPV6_PD_PREFIX = '::/64'
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ from oslo_log import log as logging
|
|||
from sqlalchemy.orm import exc
|
||||
|
||||
from neutron._i18n import _, _LW
|
||||
from neutron.common import constants as n_const
|
||||
from neutron.common import ipv6_utils as ipv6
|
||||
from neutron.common import utils
|
||||
from neutron.db.allowed_address_pairs import models as addr_pair
|
||||
|
@ -319,7 +318,7 @@ class SecurityGroupServerRpcMixin(sg_db.SecurityGroupDbMixin):
|
|||
for mac_address, network_id, ip in query:
|
||||
if (netaddr.IPAddress(ip).version == 6
|
||||
and not netaddr.IPAddress(ip).is_link_local()):
|
||||
ip = str(ipv6.get_ipv6_addr_by_EUI64(n_const.IPV6_LLA_PREFIX,
|
||||
ip = str(ipv6.get_ipv6_addr_by_EUI64(const.IPv6_LLA_PREFIX,
|
||||
mac_address))
|
||||
if ip not in ips[network_id]:
|
||||
ips[network_id].append(ip)
|
||||
|
@ -380,7 +379,7 @@ class SecurityGroupServerRpcMixin(sg_db.SecurityGroupDbMixin):
|
|||
'found for IPv6 RA'), subnet['id'])
|
||||
return
|
||||
lla_ip = str(ipv6.get_ipv6_addr_by_EUI64(
|
||||
n_const.IPV6_LLA_PREFIX,
|
||||
const.IPv6_LLA_PREFIX,
|
||||
mac_address))
|
||||
return lla_ip
|
||||
|
||||
|
|
|
@ -925,7 +925,7 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
|
|||
if netaddr.IPNetwork(ip).version == 6}
|
||||
# Allow neighbor advertisements for LLA address.
|
||||
ipv6_addresses |= {str(ipv6.get_ipv6_addr_by_EUI64(
|
||||
c_const.IPV6_LLA_PREFIX, mac))
|
||||
n_const.IPv6_LLA_PREFIX, mac))
|
||||
for mac in mac_addresses}
|
||||
if not has_zero_prefixlen_address(ipv6_addresses):
|
||||
# Install protection only when prefix is not zero because a /0
|
||||
|
|
|
@ -581,7 +581,7 @@ class SGServerRpcCallBackTestCase(test_sg.SecurityGroupDBTestCase):
|
|||
dhcp_rest = self.deserialize(self.fmt, dhcp_port)
|
||||
dhcp_mac = dhcp_rest['port']['mac_address']
|
||||
dhcp_lla_ip = str(ipv6.get_ipv6_addr_by_EUI64(
|
||||
n_const.IPV6_LLA_PREFIX,
|
||||
const.IPv6_LLA_PREFIX,
|
||||
dhcp_mac))
|
||||
|
||||
res1 = self._create_port(
|
||||
|
@ -705,7 +705,7 @@ class SGServerRpcCallBackTestCase(test_sg.SecurityGroupDBTestCase):
|
|||
gateway_mac = gateway_res['port']['mac_address']
|
||||
gateway_port_id = gateway_res['port']['id']
|
||||
gateway_lla_ip = str(ipv6.get_ipv6_addr_by_EUI64(
|
||||
n_const.IPV6_LLA_PREFIX,
|
||||
const.IPv6_LLA_PREFIX,
|
||||
gateway_mac))
|
||||
|
||||
ports_rest1 = self._make_port(
|
||||
|
@ -773,7 +773,7 @@ class SGServerRpcCallBackTestCase(test_sg.SecurityGroupDBTestCase):
|
|||
gateway_mac = gateway_res['port']['mac_address']
|
||||
gateway_port_id = gateway_res['port']['id']
|
||||
gateway_lla_ip = str(ipv6.get_ipv6_addr_by_EUI64(
|
||||
n_const.IPV6_LLA_PREFIX,
|
||||
const.IPv6_LLA_PREFIX,
|
||||
gateway_mac))
|
||||
# Create another router interface port
|
||||
interface_res = self._make_port(
|
||||
|
@ -848,7 +848,7 @@ class SGServerRpcCallBackTestCase(test_sg.SecurityGroupDBTestCase):
|
|||
gateway_mac = gateway_res['port']['mac_address']
|
||||
gateway_port_id = gateway_res['port']['id']
|
||||
gateway_lla_ip = str(ipv6.get_ipv6_addr_by_EUI64(
|
||||
n_const.IPV6_LLA_PREFIX,
|
||||
const.IPv6_LLA_PREFIX,
|
||||
gateway_mac))
|
||||
|
||||
ports_rest1 = self._make_port(
|
||||
|
|
Loading…
Reference in New Issue