Skip to content

Commit 63d8145

Browse files
committed
dnsmasq: Add locahost addresses to lo
The default listener.conf of cifmw-dnsmasq looks like this: except-interface=lo bind-dynamic listen-address=127.0.0.2 interface=cifmw-osp_trunk interface=ocpbm Once the cifmw-dnsmasq service is restarted A race/loop between dnsmasq's static binding (listen-address =127.0.0.2) and dynamic behavior (bind-dynamic). The service constantly throws an error: "failed to create listening socket for 127.0.0.2: Address already in use" and keeps creating Unnconnected sockets until It reaches the file descriptors limit and then stops working properly. There is no 127.0.0.2 IP assigned to lo interface so I suspect It may cause some race condition in the way a new IP address/interface is dynamically detected (bind-dynamic option) and the statis binding (local-address option).
1 parent b76d803 commit 63d8145

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

roles/dnsmasq/tasks/configure.yml

+9
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@
6666
- name: Render dns configuration
6767
ansible.builtin.include_tasks: dns.yml
6868

69+
- name: Add localhost addresses from defined dnsmasq listen addresses to loopback interface
70+
become: true
71+
loop: "{{ cifmw_dnsmasq_listen_addresses }}"
72+
when: item is match("^127\\..*")
73+
ansible.builtin.shell: |
74+
set -xe -o pipefail
75+
ip addr show lo | grep -q "{{ item }}" || ip addr add {{ item }}/8 dev lo
76+
changed_when: false
77+
6978
- name: Manage and start dnsmasq instance
7079
become: true
7180
when:

0 commit comments

Comments
 (0)