Reviewed: https://review.openstack.org/620900 Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=9aa7af82210f1ffb6274399648962b65162e17d1 Submitter: Zuul Branch: master
commit 9aa7af82210f1ffb6274399648962b65162e17d1 Author: Yang JianFeng <[email protected]> Date: Thu Nov 29 20:18:31 2018 +0800 Fix the bug about DHCP port whose network has multiple subnets. When a subnet's enable_dhcp attribute is updated, we must restart dhcp device. So,when we decide whether 'restart' or 'reload_allocations' in refresh_dhcp_helper function we only compare the cidr of subnets which enabled dhcp. The previous logic only calls 'restart' when deleting or adding a subnet. This may cause the dhcp port not updated when the subnet's enable_dhcp is updated to True. Change-Id: Ic547946ac786c5fab82b4ee7078bf86483f51eb5 Closes-Bug: #1805824 ** Changed in: neutron Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1805824 Title: The dhcp port's address may be messed when the port's network has multiple subnets Status in neutron: Fix Released Bug description: 1、When I update one of the subnets's enable_dhcp attribute from true to false, the dhcp port still has the IP of the subnet I updated. Reproducible Steps: openstack network create test-dhcp openstack subnet create --network test-dhcp --subnet-range 2.2.2.0/24 test-dhcp-subnet01 openstack subnet create --network test-dhcp --subnet-range 3.3.3.0/24 test-dhcp-subnet02 openstack subnet set test-dhcp-subnet01 --no-dhcp Then I login the host of hold the network's dhcp namespace and check the namesapce. The result is as follows, the IP belong to test-dhcp-subnet01 is still exist. ip netns exec qdhcp-7ba959b7-299e-4f6c-a806-b6846e1dde68 ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 18: tapf258f8cc-0d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default qlen 1000 link/ether fa:16:3e:9b:3d:7a brd ff:ff:ff:ff:ff:ff inet 2.2.2.2/24 brd 2.2.2.255 scope global tapf258f8cc-0d valid_lft forever preferred_lft forever inet 169.254.169.254/16 brd 169.254.255.255 scope global tapf258f8cc-0d valid_lft forever preferred_lft forever inet 3.3.3.3/24 brd 3.3.3.255 scope global tapf258f8cc-0d valid_lft forever preferred_lft forever inet6 fe80::f816:3eff:fe9b:3d7a/64 scope link valid_lft forever preferred_lft forever Next, I restart the neutron-dhcp-agent and check the namesapce again. The IP belong to test-dhcp-subnet01 is disappeared. systemctl restart neutron-dhcp-agent ip netns exec qdhcp-7ba959b7-299e-4f6c-a806-b6846e1dde68 ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 18: tapf258f8cc-0d: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default qlen 1000 link/ether fa:16:3e:9b:3d:7a brd ff:ff:ff:ff:ff:ff inet 169.254.169.254/16 brd 169.254.255.255 scope global tapf258f8cc-0d valid_lft forever preferred_lft forever inet 3.3.3.3/24 brd 3.3.3.255 scope global tapf258f8cc-0d valid_lft forever preferred_lft forever inet6 fe80::f816:3eff:fe9b:3d7a/64 scope link valid_lft forever preferred_lft forever 2、When I update one of the subnets's enable_dhcp attribute from false to true, the DHCP port's IP belong to the subnet I updated no be set. Reproducible Steps: openstack network create test-dhcp openstack subnet create --network test-dhcp --subnet-range 2.2.2.0/24 test-dhcp-subnet01 openstack subnet create --network test-dhcp --subnet-range 3.3.3.0/24 test-dhcp-subnet02 --no-dhcp openstack subnet set test-dhcp-subnet02 --dhcp Then I login the host of hold the network's dhcp namespace and check the namesapce. The result is as follows, the IP belong to test-dhcp-subnet02 is missing: ip netns exec qdhcp-08621ab0-e012-459c-9a1c-a8f24b56f881 ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 19: tape7959c7d-39: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default qlen 1000 link/ether fa:16:3e:a8:4d:fe brd ff:ff:ff:ff:ff:ff inet 2.2.2.2/24 brd 2.2.2.255 scope global tape7959c7d-39 valid_lft forever preferred_lft forever inet 169.254.169.254/16 brd 169.254.255.255 scope global tape7959c7d-39 valid_lft forever preferred_lft forever inet6 fe80::f816:3eff:fea8:4dfe/64 scope link valid_lft forever preferred_lft forever Then I restart the neutron-dhcp-agent, The result becomes correct. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 19: tape7959c7d-39: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default qlen 1000 link/ether fa:16:3e:a8:4d:fe brd ff:ff:ff:ff:ff:ff inet 2.2.2.2/24 brd 2.2.2.255 scope global tape7959c7d-39 valid_lft forever preferred_lft forever inet 169.254.169.254/16 brd 169.254.255.255 scope global tape7959c7d-39 valid_lft forever preferred_lft forever inet 3.3.3.2/24 brd 3.3.3.255 scope global tape7959c7d-39 valid_lft forever preferred_lft forever inet6 fe80::f816:3eff:fea8:4dfe/64 scope link valid_lft forever preferred_lft forever To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1805824/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

