Skip to content

RDKCOM-5612: RDKBNETWOR-16 DNS Relay Feature - #377

Open
pradeeptakdas wants to merge 1 commit into
rdkcentral:developfrom
pradeeptakdas:RDKBNETWOR-16
Open

RDKCOM-5612: RDKBNETWOR-16 DNS Relay Feature#377
pradeeptakdas wants to merge 1 commit into
rdkcentral:developfrom
pradeeptakdas:RDKBNETWOR-16

Conversation

@pradeeptakdas

Copy link
Copy Markdown

Reason for change: Implementation of DNS forward proxy
Test Procedure: DNS Relay DM functionality and proxy functionality
Risks: None.

Signed-off-by: Sherik Sensin A sherik.a@t-systems.com
Change-Id: I930ffa57b58c2e2123f731d5b6cb74fd88cd594c

Reason for change: Implementation of DNS forward proxy
Test Procedure: DNS Relay DM functionality and proxy functionality
Risks: None.

Change-Id: I930ffa57b58c2e2123f731d5b6cb74fd88cd594c
Signed-off-by: Sherik Sensin A <sherik.a@t-systems.com>
Copilot AI review requested due to automatic review settings July 22, 2026 13:22
@pradeeptakdas
pradeeptakdas requested review from a team as code owners July 22, 2026 13:22
@github-actions

Copy link
Copy Markdown

📋 PR Format Reminder

  • Description missing:
    • Priority (P0 / P1 / P2)

Expected:

TICKET-123 : brief description

Reason for change: why
Test Procedure: how to verify
Risks: Low / Medium / High
Priority: P0 / P1 / P2

@pradeeptakdas pradeeptakdas changed the title RDKBNETWOR-16 : DNS Relay Feature RDKCOM-5612: RDKBNETWOR-16 DNS Relay Feature Jul 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements a DNS relay / forward-proxy capability by introducing new syscfg/utopia keys and UTAPI accessors, and updating the dnsmasq (DHCP/DNS) service scripts to generate separate WAN/LAN dnsmasq configurations and run multiple dnsmasq instances when relay is enabled.

Changes:

  • Added new Utopia/syscfg keys and enum values for dns_relay_enable and dns_forward_count.
  • Introduced UTAPI DNS helpers (utapi_dns.h/.c) for getting/setting DNS relay enable and reading DNS forward count.
  • Updated DHCP/DNS service scripts to generate split dnsmasq configs and start/monitor separate LAN/WAN dnsmasq processes; added LAN handler bridge bring-up logic.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
source/utctx/lib/utctx.c Adds syscfg token mappings for DNS relay enable and forward count.
source/utctx/lib/utctx_api.h Adds new UtopiaValue_* enum entries for DNS relay feature (library header).
source/include/utctx/utctx_api.h Adds matching new UtopiaValue_* enum entries for exported header.
source/utapi/lib/utapi.h Extends DNS_Client_t with alias storage.
source/include/utapi/utapi.h Mirrors the DNS_Client_t struct extension in exported header.
source/utapi/lib/utapi_dns.h New header exposing DNS relay/forward-count UTAPI functions.
source/utapi/lib/utapi_dns.c Adds DNS relay enable wrappers and forward-count accessor.
source/scripts/init/service.d/service_dhcp_server/dhcp_server_functions.sh Generates split dnsmasq config and resolver file for relay mode.
source/scripts/init/service.d/service_dhcp_server.sh Starts/monitors dnsmasq differently when relay is enabled (LAN+WAN instances).
source/scripts/init/service.d/lan_handler.sh Adds physical-interface-to-bridge bring-up logic (RPi-specific block).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +149 to +158
static int g_Dns_ForwardCount = 0;

int Utopia_GetNumberOfDnsForwards(UtopiaContext *ctx)
{
if(g_Dns_ForwardCount == 0)
{
Utopia_GetInt(ctx, UtopiaValue_Dns_ForwardCount, &g_Dns_ForwardCount);
}
return g_Dns_ForwardCount;
}
Comment on lines +724 to +736
prepare_dns_proxy_conf()
{
get_static_dns_ips ipv6
get_static_dns_ips ipv4
ind=0
for ip in $STATIC_DNS_IPv4;
do
((ind++))
echo "nameserver $ip" >> $DNS_PROXY_RESOLV_CONF_TMP
done
cat $DNS_PROXY_RESOLV_CONF_TMP > $DNS_PROXY_RESOLV_CONF
rm $DNS_PROXY_RESOLV_CONF_TMP
}
then
echo "${PREFIX}interface=${IFNAME}" >> $LOCAL_DHCP_CONF
echo "${PREFIX}""dhcp-range=set:$i,${m_DHCP_START_ADDR},${m_DHCP_END_ADDR},$m_LAN_SUBNET,${m_DHCP_LEASE_TIME}" >> $LOCAL_DHCP_CONF
echo "${PREFIX}""interface="${IFNAME} >> $LOCAL_DHCP_CONF_LAN
Comment on lines +149 to +166
$SERVER -u nobody -P 4096 -C $DHCP_CONF_LAN
$SERVER -u nobody -P 4096 -C $DHCP_CONF_WAN

WANPID=`ps -ef | grep dnsmasq_wan | head -n 1| cut -d" " -f1`
if [ -z "$WANPID" ] ; then
WANPID=`ps -ef | grep dnsmasq_wan | head -n 1| cut -d" " -f2`
echo $WANPID > $WAN_PID_FILE
else
echo $WANPID > $WAN_PID_FILE
fi

LANPID=`ps -ef | grep dnsmasq_lan | head -n 1| cut -d" " -f1`
if [ -z "$LANPID" ] ; then
LANPID=`ps -ef | grep dnsmasq_lan | head -n 1| cut -d" " -f2`
echo $LANPID > $LAN_PID_FILE
else
echo $LANPID > $LAN_PID_FILE
fi
Comment on lines +304 to +305
if [ -n "$FOO" ] || [ -n "$FOO1"]; then
RESTART=1
WAN_CONF_PID=`cat $WAN_PID_FILE`
fi

if [ -z "$LAN_PID_FILE" ] || [ -z "$WAN_PID_FILE" ] ; then
Comment on lines +1077 to +1084
$SERVER -u nobody -P 4096 -C $DHCP_CONF_WAN
WANPID=`ps -ef | grep dnsmasq_wan | head -n 1| cut -d" " -f1`
if [ -z "$WANPID" ] ; then
WANPID=`ps -ef | grep dnsmasq_wan | head -n 1| cut -d" " -f2`
echo $WANPID > $WAN_PID_FILE
else
echo $WANPID > $WAN_PID_FILE
fi
Comment on lines +1090 to +1097
$SERVER -u nobody -P 4096 -C $DHCP_CONF_LAN
LANPID=`ps -ef | grep dnsmasq_lan | head -n 1| cut -d" " -f1`
if [ -z "$LANPID" ] ; then
LANPID=`ps -ef | grep dnsmasq_lan | head -n 1| cut -d" " -f2`
echo $LANPID > $LAN_PID_FILE
else
echo $LANPID > $LAN_PID_FILE
fi
Comment on lines +323 to +330
PHY_ETH_IFNAMES=`syscfg get lan_ethernet_physical_ifnames`
IFS=' ' read -r -a PHY_ETH_IFNAME_ARRAY <<< "$PHY_ETH_IFNAMES"
for PHY_ETH_IFNAME in "${PHY_ETH_IFNAME_ARRAY[@]}"
do
echo "LAN HANDLER : PHY_ETH_IFNAME = $PHY_ETH_IFNAME"
ifconfig $PHY_ETH_IFNAME up
brctl addif $PHY_BRIDGE_IFNAME $PHY_ETH_IFNAME
done
Comment on lines +689 to +691
get_static_dns_ips(){
ind=1

{
if(g_Dns_ForwardCount == 0)
{
Utopia_GetInt(ctx, UtopiaValue_Dns_ForwardCount, &g_Dns_ForwardCount);
@AkhilaReddyK7 AkhilaReddyK7 added the community-contribution Contribution from community label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contribution from community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants