Repository navigation
Optimize kernel default-route detection in startup gateway check - #20
Merged
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix code based on review comment 3495055507
Optimize kernel default-route detection in startup gateway check
Jul 6, 2026
The current netifd check works for regular OpenWrt WAN interfaces, but it can fail on routers where default routing is installed by routing daemons rather than exposed as an interface route in `ubus call network.interface dump`. One example is Freifunk mesh core routers using Babel or OLSR. These nodes may have usable IPv4 or IPv6 default routing in the kernel, while netifd does not report a WAN-style default route. `gateway_check=kernel` allows adblock-fast to wait for kernel default route availability in those setups, while `gateway_check=none` supports environments where startup should not be gated on default-route discovery at all. The default remains `netifd`, so existing behavior is unchanged for normal OpenWrt routers.
stangri
marked this pull request as ready for review
July 6, 2026 20:17
Collaborator
|
@copilot resolve the merge conflicts in this pull request |
Contributor
Author
Resolved in I merged |
Collaborator
|
@copilot address the following failing test: |
Contributor
Author
... Addressed in I updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses only the linked review comment by tightening the kernel gateway check used during startup polling. The change keeps behavior intact while making the route probe less format-dependent and cheaper per invocation.
Scope (single review comment only)
_check_kernel_gateway()infiles/lib/adblock-fast/adblock-fast.uc.Kernel route probe simplification
grep -q '^default'withgrep -q .for both IPv4 and IPv6 default-route checks.ip route show defaultto filter route type, and only checks for non-empty output.