[components][lwip] add support for independent dns services for multiple network devices #9433
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.
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
在使用多个网络设备时,
dns servers
会被DHCP
应答处理设置到所有网络设备WiFi + ETH + PPP
三个网络设备的情况下,WiFi
和ETH
往往使用的是网关作为DNS服务器WiFi
和ETH
发起DHCP
请求时,PPP设备(GSM模组)
的DNS服务器也会被设置到WiFi
和ETH
的网关IP
默认的网络
是PPP网络设备
,那么发起的DNS
请求会到WiFi/ETH
的网关IP
去,导致gethostbyname
超时以下是修改前的DNS IP
GSM
启动较慢,WiFi
和ETH
先获取到了DNS
,而后面启动的PPP网络设备
将WiFi
和ETH
的DNS
都给改掉了WiFi
和ETH
再次发起DHCP
请求时,PPP网络设备
的DNS
会被换成WiFi
和ETH
的DNS
你的解决方案是什么 (what is your solution)
添加独立的DNS Servers支持,每个网络设备都有自己的DNS,使用默认网络设备的DNS并在udp中绑定对应网络设备
dns.c
文件的dns_send
函数中,读取默认网络设备
的dns servers
并在发起udp
数据前绑定该dns servers
对应的网络设备
DHCP
应答中使用netdev_set_dns_server
来设置对应网卡的DNS
,而不是使用dns_setserver
修改所有网络设备
的DNS
以下是修改后的DNS IP
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up