-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix static IP not set if IP is already present in any way inside dhcpcd.conf #4995
Fix static IP not set if IP is already present in any way inside dhcpcd.conf #4995
Conversation
A certificate error (cert expired) causes a centos_9 test to fail. Addidtionally the mirror links return a 404. Shouldn't be related to the PR.
|
Signed-off-by: Stephan Pillhofer <43667664+StephanPillhofer@users.noreply.github.com>
b23870f
to
06cf7af
Compare
With the anchors, the The current code with the ending anchor will fail with something like this
I think the trailing anchor should be removed. |
You are right, didn't think about the possibility of adding a comment at the end. Also the New Regex will be: |
I also tested with different regex/grep combinations and came to the same conclusion. Please open a new PR if you want :) |
Is an inline trailing comment a valid configuration? |
The manual says
Ok, this was for |
Can you link to that please? The only thing I have found is
From https://manpages.debian.org/testing/dhcpcd5/dhcpcd.conf.5.en.html |
So in the worst case the comment may be part of the "value" part which would not be good. |
The relevant code section should be |
Apparently it seems to be valid:
From: https://www.daemon-systems.org/man/dhcpcd.conf.5.html (scroll a bit down) |
My c is not the best but I would also see the code as an indication that it is valid to do inline comments. |
Yeah, the |
My |
New PR created: #4998 |
Signed-off-by: Stephan Pillhofer 43667664+StephanPillhofer@users.noreply.github.com
This PR solves a bug which prevents the
dhcpcd.conf
file from being changed when the user wants to assign a static IP address to the RaspberryPi. The bug occurs because the target static IP address may already be present in any form in the (default)dhcpcd.conf
file. (e.g. the IP address may be mentioned in another setting than "static ip_address" or it may be present in a commented example setting)The bug is resolved by utilizing a regular expression for matching a valid non-commented static IP addess entry (e.g.
static ip_address=192.168.10.2/24
)none
By submitting this pull request, I confirm the following:
git rebase
)