DHCP agent should specify prefix-len for IPv6 dhcp-range's

Bug #1372883 reported by Alexey I. Froloff
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Alexey I. Froloff
Juno
Fix Released
Undecided
Unassigned

Bug Description

If Network contains Subnet smaller than /64, prefix-len should be specified for dnsmasq's --dhcp-range option.

tags: added: ipv6 l3-ipam-dhcp
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/125026

Changed in neutron:
assignee: nobody → Alexey I. Froloff (raorn)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/125026
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f996a7b46878f543ecf775380529af10fe87b8cb
Submitter: Jenkins
Branch: master

commit f996a7b46878f543ecf775380529af10fe87b8cb
Author: Alexey I. Froloff <email address hidden>
Date: Tue Sep 30 16:37:19 2014 +0400

    Specify prefix length for IPv6 subnets

    If Network contains dhcpv6-stateful Subnet with prefix other than /64,
    dnsmasq refuses to start if prefix-len is not specified in dhcp-range
    option. From dnsmasq(8) manpage:

        For IPv6, the parameters are slightly different: instead of netmask
        and broadcast address, there is an optional prefix length which must
        be equal to or larger then the prefix length on the local interface.
        If not given, this defaults to 64. Unlike the IPv4 case, the prefix
        length is not automatically derived from the interface
        configuration. The mimimum size of the prefix length is 64.

    It is safe to always specify prefix length, so dnsmasq will use correct
    configuration.

    Change-Id: Ibef1f55926585016f0054accd7f7ef5a022e3fe1
    Closes-Bug: #1372883

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/147799

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/juno)

Reviewed: https://review.openstack.org/147799
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=82bf4afdf9a80a3f7875d1908c5fac17fd037fee
Submitter: Jenkins
Branch: stable/juno

commit 82bf4afdf9a80a3f7875d1908c5fac17fd037fee
Author: Alexey I. Froloff <email address hidden>
Date: Tue Sep 30 16:37:19 2014 +0400

    Specify prefix length for IPv6 subnets

    If Network contains dhcpv6-stateful Subnet with prefix other than /64,
    dnsmasq refuses to start if prefix-len is not specified in dhcp-range
    option. From dnsmasq(8) manpage:

        For IPv6, the parameters are slightly different: instead of netmask
        and broadcast address, there is an optional prefix length which must
        be equal to or larger then the prefix length on the local interface.
        If not given, this defaults to 64. Unlike the IPv4 case, the prefix
        length is not automatically derived from the interface
        configuration. The mimimum size of the prefix length is 64.

    It is safe to always specify prefix length, so dnsmasq will use correct
    configuration.

    Change-Id: Ibef1f55926585016f0054accd7f7ef5a022e3fe1
    Closes-Bug: #1372883
    (cherry picked from commit f996a7b46878f543ecf775380529af10fe87b8cb)

tags: added: in-stable-juno
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Revision history for this message
Eran Kuris (ekuris) wrote :
Revision history for this message
Alexey I. Froloff (raorn) wrote :
Revision history for this message
Eran Kuris (ekuris) wrote :

Alexey , how can I make it return false , dont really understand ?!?!

Revision history for this message
Alexey I. Froloff (raorn) wrote :

This method returns False for DHCPv6-stateful subnets. If this method returns False, prefixlen is not checked for this subnet.

Revision history for this message
Eran Kuris (ekuris) wrote :

so this bug is relevant only for DHCPv6-stateful ??

Revision history for this message
Alexey I. Froloff (raorn) wrote :

Eran, have you tried reading the commit message?

Revision history for this message
Eran Kuris (ekuris) wrote :

off course I'm but I don't understand you.
I saw " modes = [constants.IPV6_SLAAC, constants.DHCPV6_STATELESS]"
but I don't understand how this method returns false for stateful subnets .
I tried to create stateless subnet less then /64 but I got an error . I trying to understand how can i reproduce this bug .

Revision history for this message
Alexey I. Froloff (raorn) wrote :

Why are you creating stateless subnet, whilecommit message mentions stateful subnet?

Revision history for this message
Eran Kuris (ekuris) wrote :

def is_auto_address_subnet(subnet):
    """Check if subnet is an auto address subnet."""
    modes = [constants.IPV6_SLAAC, constants.DHCPV6_STATELESS]
    return (subnet['ipv6_address_mode'] in modes
            or subnet['ipv6_ra_mode'] in modes)

According to this I don't see stateful .

Revision history for this message
Eran Kuris (ekuris) wrote :

Alexey , I want to reproduce the problem . please write me steps what should I do to reproduce it .
step by step and it will help me to understand the problem.
thanks

Revision history for this message
Eran Kuris (ekuris) wrote :

Alexly , finally I success to create stateful subnet smaller then /64
I want to understand what I expected to see in dnsmasq???

[root@puma15 ~(keystone_admin)]# neutron subnet-show 76c13e30-31e3-4706-97b1-ea23dc7055f1
+-------------------+----------------------------------------------------------+
| Field | Value |
+-------------------+----------------------------------------------------------+
| allocation_pools | {"start": "2001::2", "end": "2001::ffff:ffff:ffff:fffe"} |
| cidr | 2001::/64 |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 2001::1 |
| host_routes | |
| id | 76c13e30-31e3-4706-97b1-ea23dc7055f1 |
| ip_version | 6 |
| ipv6_address_mode | dhcpv6-stateful |
| ipv6_ra_mode | dhcpv6-stateful |
| name | ipv6_stateful |
| network_id | e6ced721-0539-48b9-9b1b-35d89a26c23f |
| tenant_id | e706e4f6180447f9b6acba60086948ab |
+-------------------+----------------------------------------------------------+
# ps -ef | grep dnsmasq
nobody 14607 1 0 Mar15 ? 00:00:00 dnsmasq --no-hosts --no-resolv --strict-order --bind-interfaces --interface=tapeb7835e5-fb --except-interface=lo --pid-file=/var/lib/neutron/dhcp/afddd5d9-9178-467b-8d2f-9953f4be998a/pid --dhcp-hostsfile=/var/lib/neutron/dhcp/afddd5d9-9178-467b-8d2f-9953f4be998a/host --addn-hosts=/var/lib/neutron/dhcp/afddd5d9-9178-467b-8d2f-9953f4be998a/addn_hosts --dhcp-optsfile=/var/lib/neutron/dhcp/afddd5d9-9178-467b-8d2f-9953f4be998a/opts --leasefile-ro --dhcp-range=set:tag0,192.168.1.0,static,86400s --dhcp-lease-max=256 --conf-file=/etc/neutron/dnsmasq-neutron.conf --domain=openstacklocal
root 28775 28689 0 11:50 pts/2 00:00:00 grep --color=auto dnsmasq

Revision history for this message
Alexey I. Froloff (raorn) wrote :

No, you don't. And this dnasmasq is serving different network.

Revision history for this message
Eran Kuris (ekuris) wrote :

how can we contact via IRC ?

Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-2 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.