Get domain name for dhcp from neutron db

Bug #1893802 reported by StreSS.t
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
New
Undecided
Unassigned

Bug Description

Neutron maintains a dns_domain entry for networks, but the record is not used as a domain in dhcp options

This patch added support domain name in dhcp options.

diff --git a/neutron/agent/linux/dhcp.py b/neutron/agent/linux/dhcp.py
index c2fed93a82..cb37e7826c 100644
--- a/neutron/agent/linux/dhcp.py
+++ b/neutron/agent/linux/dhcp.py
@@ -465,8 +465,12 @@ class Dnsmasq(DhcpLocalProcess):
         for server in self.conf.dnsmasq_dns_servers:
             cmd.append('--server=%s' % server)

- if self.conf.dns_domain:
- cmd.append('--domain=%s' % self.conf.dns_domain)
+ if self.network.dns_domain:
+ cmd.append('--domain=%s' % self.network.dns_domain)
+
+ if self.network.dns_domain == None or self.network.dns_domain == "" :
+ if self.conf.dns_domain:
+ cmd.append('--domain=%s' % self.conf.dns_domain)

         if self.conf.dhcp_broadcast_reply:
             cmd.append('--dhcp-broadcast')

What should I do to send to upstream?

Revision history for this message
Lajos Katona (lajos-katona) wrote :

Hi,
if I understand well this is some downstream code which you referenced here.
To report a public launchpad bug is a good start.
General contributor guide: https://docs.openstack.org/contributors/

Neutron specific additions: https://docs.openstack.org/neutron/latest/contributor/index.html

If you push the fix please reference this bug report to the commit msg (i.e.: https://review.opendev.org/#/c/715483/23//COMMIT_MSG , with Closes-Bug: #1893802 ) and if you use a topic like bug/1893802 that can help as well.

If you have more questions you can ask on irc (#openstack-nutron channel) or via mail to <email address hidden>

Revision history for this message
Bernard Cafarelli (bcafarel) wrote :

Also, I think this is similar to a previous change:
Pass network's dns_domain to dnsmasq conf - https://review.opendev.org/#/c/571546/

This was later reverted:
Revert "Pass network's dns_domain to dnsmasq conf" - https://review.opendev.org/#/c/657806/

More details in https://bugs.launchpad.net/neutron/+bug/1826419

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.