-
-
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
pihole -d: Fix gateway ping if it is a LL address #5527
Conversation
…ress Signed-off-by: DL6ER <dl6er@dl6er.de>
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pihole-v6-debug-bug-found/67134/3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you extend the PR for the dig
check at
pi-hole/advanced/Scripts/piholeDebug.sh
Lines 758 to 782 in 6e8029f
addresses="$(ip address show dev "${iface}" | sed "/${sed_selector} /!d;s/^.*${sed_selector} //g;s/\/.*$//g;")" | |
if [ -n "${addresses}" ]; then | |
while IFS= read -r local_address ; do | |
# Check if Pi-hole can use itself to block a domain | |
if local_dig="$(dig +tries=1 +time=2 -"${protocol}" "${random_url}" @"${local_address}" "${record_type}")"; then | |
# If it can, show success | |
if [[ "${local_dig}" == *"status: NOERROR"* ]]; then | |
local_dig="NOERROR" | |
elif [[ "${local_dig}" == *"status: NXDOMAIN"* ]]; then | |
local_dig="NXDOMAIN" | |
else | |
# Extract the first entry in the answer section from dig's output, | |
# replacing any multiple spaces and tabs with a single space | |
local_dig="$(echo "${local_dig}" | grep -A1 "ANSWER SECTION" | grep -v "ANSWER SECTION" | tr -s " \t" " ")" | |
fi | |
log_write "${TICK} ${random_url} ${COL_GREEN}is ${local_dig}${COL_NC} on ${COL_CYAN}${iface}${COL_NC} (${COL_CYAN}${local_address}${COL_NC})" | |
else | |
# Otherwise, show a failure | |
log_write "${CROSS} ${COL_RED}Failed to resolve${COL_NC} ${random_url} on ${COL_RED}${iface}${COL_NC} (${COL_RED}${local_address}${COL_NC})" | |
fi | |
done <<< "${addresses}" | |
else | |
log_write "${TICK} No IPv${protocol} address available on ${COL_CYAN}${iface}${COL_NC}" | |
fi | |
done <<< "${interfaces}" |
(Also reported on the linked Discourse post, second half of the intial post)
…ction Signed-off-by: DL6ER <dl6er@dl6er.de>
Added screenshots to the PR description |
What does this implement/fix?
Fix pinging the interface by appending the connected interface's identifier to the gateway address if it is a link-local address.
Before:
After:
Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase
)Checklist:
developmental
branch.