Skip to content

dnsmasq: Add locahost addresses to lo #2863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

krcmarik
Copy link
Contributor

@krcmarik krcmarik commented Apr 2, 2025

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).

Copy link
Contributor

openshift-ci bot commented Apr 2, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

openshift-ci bot commented Apr 2, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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).
@krcmarik krcmarik marked this pull request as ready for review April 3, 2025 11:55
@krcmarik krcmarik requested a review from a team as a code owner April 3, 2025 11:55
@danpawlik
Copy link
Contributor

danpawlik commented Apr 3, 2025

I don't think that it is a right way to do that and the error message is correct
https://review.rdoproject.org/r/plugins/gitiles/config/+/refs/heads/master/roles/prepare-crc-extracted/tasks/dnsmasq-nm.yaml#62
I think the bind-interfaces is doing that you can not do what you want. I think when you check localhost ip address it would be pointing to 127.0.0.2 in /etc/hosts

Edit:
After longer thinking, I think it still would not work until except-interface=lo is not removed or bind-dynamic.
Or, change from bind-dynamic to bind-interfaces - bind only to IPs/interfaces that exist currently (need to check).

Copy link

This PR is stale because it has been for over 15 days with no activity.
Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 30, 2025
@dasm
Copy link
Contributor

dasm commented May 5, 2025

@krcmarik please address @danpawlik comments. Thank you!

@github-actions github-actions bot removed the Stale label May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants