Repository navigation
RDKB-64441: Redirect only XDNS clients to dnsmasq instead of all LAN clients - #462
Open
rajkamal-cv wants to merge 1 commit into
Open
rajkamal-cv wants to merge 1 commit into
rajkamal-cv wants to merge 1 commit into
Conversation
…clients Reason for change: All DNS traffic was redirected to dnsmasq when XDNS was enabled, so one flooding client could hit dnsmasq's 150-query forward limit and block DNS for all other clients. Test Procedure: Configure per-client and global XDNS, verify only intended clients are redirected. Risks: Low Priority: P1 Signed-off-by: rajkamal_cv@comcast.com
|
📋 PR Format Reminder
Expected: |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Malformed PUMA7 protocol options prevent NAT updates, and incorrect WAN resolver detection can preserve unintended all-client redirection.
2 open issues
What changed in this PR
This PR narrows firewall DNS redirection to XDNS-configured clients, aiming to prevent non-XDNS traffic from exhausting dnsmasq’s forwarding queue while preserving global XDNS behavior.
Changes:
- Parses
dnsoverrideentries to generate MAC-specific IPv4 and IPv6 redirects. - Adds default-resolver classification to determine when all-client redirection is needed.
- Centralizes redirect rule generation and reports redirect counts.
| File | Description |
|---|---|
| source/firewall/firewall.c | Adds XDNS configuration parsing and selective DNS redirect generation. |
Review effort: Balanced
Comment on lines
+9071
to
+9082
| fprintf(nat_fp, "-A prerouting_fromlan -i %s ! -s 169.254.0.0/16 %sp udp --dport 53 -j DNAT --to-destination %s\n",lan_ifname,mac_match,dns_dest); | ||
| fprintf(nat_fp, "-A prerouting_fromlan -i %s ! -s 169.254.0.0/16 %sp tcp --dport 53 -j DNAT --to-destination %s\n",lan_ifname,mac_match,dns_dest); | ||
| #else | ||
| fprintf(nat_fp, "-A prerouting_fromlan -i %s %s-p udp --dport 53 -j DNAT --to-destination %s\n",lan_ifname,mac_match,dns_dest); | ||
| fprintf(nat_fp, "-A prerouting_fromlan -i %s %s-p tcp --dport 53 -j DNAT --to-destination %s\n",lan_ifname,mac_match,dns_dest); | ||
| #endif | ||
| } | ||
| else | ||
| { | ||
| #if defined (INTEL_PUMA7) | ||
| fprintf(nat_fp, "-A PREROUTING -i %s ! -s 2603:2000::/20 %sp udp --dport 53 -j DNAT --to-destination %s\n",lan_ifname,mac_match,dns_dest); | ||
| fprintf(nat_fp, "-A PREROUTING -i %s ! -s 2603:2000::/20 %sp tcp --dport 53 -j DNAT --to-destination %s\n",lan_ifname,mac_match,dns_dest); |
| if (iptype == 4) | ||
| { | ||
| int i; | ||
| const char *ns_keys[3] = {"dhcp_nameserver_1", "dhcp_nameserver_2", "dhcp_nameserver_3"}; |
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.


RDKB-64441: Redirect only XDNS clients to dnsmasq instead of all LAN clients
Reason for change: All DNS traffic was redirected to dnsmasq when XDNS was enabled, so one flooding client could hit dnsmasq's 150-query forward limit and block DNS for all other clients. Test Procedure: Configure per-client and global XDNS, verify only intended clients are redirected.
Risks: Low
Priority: P1
Signed-off-by: rajkamal_cv@comcast.com
Related PR - rdkcentral/xdns#33