Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1124,8 +1124,21 @@ fi
#prepare_dhcp_options
prepare_dhcp_options_wan_dns
fi

if [ "$FIRMWARE_TYPE" != "OFW" ]; then
DSLITE_ENABLE=$(syscfg get dslite_enable)

# DS-Lite: use brlan0 bridge IP as DNS
if [ "$DSLITE_ENABLE" = "1" ]; then
LAN_IP=$(syscfg get lan_ipaddr)

if [ -n "$LAN_IP" ]; then
echo "option:dns-server,$LAN_IP" >> "$DHCP_OPTIONS_FILE"
fi
fi
fi

if [ "$BOX_TYPE" != "HUB4" ] && [ "$BOX_TYPE" != "SR300" ] && [ "$BOX_TYPE" != "SE501" ] && [ "$BOX_TYPE" != "SR213" ] && [ "$SelfHealSupport" != "true" ]; then
if [[ "$FIRMWARE_TYPE" != "OFW" && "$DSLITE_ENABLE" != "1" ]] && [ "$BOX_TYPE" != "HUB4" ] && [ "$BOX_TYPE" != "SR300" ] && [ "$BOX_TYPE" != "SE501" ] && [ "$BOX_TYPE" != "SR213" ] && [ "$SelfHealSupport" != "true" ]; then
nameserver=`grep "nameserver" $RESOLV_CONF | awk '{print $2}'|grep -v ":"|tr '\n' ','| sed -e 's/,$//'`
if [ -n "$nameserver" ]; then
echo "option:dns-server,$nameserver" >> $DHCP_OPTIONS_FILE
Expand Down
23 changes: 21 additions & 2 deletions source/service_dhcp/dhcp_server_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1606,8 +1606,27 @@ int prepare_dhcp_conf (char *input)
prepare_dhcp_options_wan_dns();
}

#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR_PRODUCT_REQ_)
#if !defined _LG_OFW_
char dslite_enable[8] = {0};
if (syscfg_get(NULL, "dslite_enable", dslite_enable, sizeof(dslite_enable)) == 0 && !strcmp(dslite_enable, "1"))
{
FILE *fp = fopen(DHCP_OPTIONS_FILE, "a");
if (fp)
{
char lan_ip[32] = {0};

if (!syscfg_get(NULL, "lan_ipaddr", lan_ip, sizeof(lan_ip)) &&
lan_ip[0] != '\0')
{
fprintf(fp, "option:dns-server,%s\n", lan_ip);
}
fclose(fp);
}
}
else
#endif /* _LG_OFW_ */
{
#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR_PRODUCT_REQ_)
struct in_addr ipv4Addr;
int ret = -1;
int resComp = -1;
Expand Down Expand Up @@ -1656,8 +1675,8 @@ int prepare_dhcp_conf (char *input)
{
fprintf(g_fArmConsoleLog, "DHCP_SERVER : Error in opening %s\n",RESOLV_CONF );
}
}
#endif
}

sysevent_get(g_iSyseventfd, g_tSysevent_token, "lan-status", l_cLan_Status, sizeof(l_cLan_Status));
if (!strncmp(l_cLan_Status, "started", 7))
Expand Down