YISH
YISH
any progress on this issue?
I just want the `ValueError`, not the `UnwrapError`. due to external code doesn't know about `UnwrapError`. Without this PR, I can only use `err.unwrap_or_raise(lambda e: e)`, it's a bit troublesome.
我也没有 ios 设备
我的 macbook 是正常的,仅限苹果手机?
计划是有,但个人精力有限。我看你也会写 rust,你可以看看能不能集成这个 https://github.com/bluecatengineering/dhcproto 这样就具备 dnsmasq dns 和 dhcp 两个功能了。
edge-dhcp 好像只支持 ipv4。dhcproto 的作者在另外一个仓库写了 dhcp server 项目,https://github.com/bluecatengineering/dora 这个项目比较复杂用 sqlite 管理 IP 分配的数据的,设计应该是面向更大规模的 IP 分配的,如果是家用,或者少量设备,我觉得用配置文件记录就足够了。 DHCP 我理解,通过 udp 接收客户端的消息,看是静态 IP 还是,顺序或者随机分配 IP ,构造结果消息,返回给客户端。 我也没搞过,边写边学的,我也是通过这个项目练手,对 rust 熟悉了不少。
> 我其实是想把smartdns作为dhcp的客户端,用于获取路由器自带DNS服务器的IP,不做服务端。因为我把它装在笔记本里,以便在不同的环境使用。不知道这个功能要不要做?如果可以做,我去试试能不能实现 这个操作系统会替你做的,smartdns 去获取系统默认的 DNS 服务器 IP 就可以了。 你可以加个 ```conf server system -g HomeRouter # 新增支持这个就是了,发现是 system,就从调用 read_system_conf 获取系统 DHCP 分配的 DNS 服务器 IP server https://dns.alidns.com -g china ``` https://github.com/hickory-dns/hickory-dns/blob/9c733c63a440f525eea2b44564ec3f806479d0df/crates/resolver/src/system_conf/mod.rs#L29
那要支持两种上游服务器定义方式 ```conf server dhcp -g dhcp # 使用路由器通告的 dns server server system -g system # 使用网卡的 dns server ```
确实得先排序。如果没有定义 bootstrap 会自动找哪些 group 中有 IP 的 nameserver 所以才有去重。 对了 DHCP 客户端的样例,我加了: https://github.com/bluecatengineering/dhcproto/pull/85/files
去重那个,你有想法,确实更好可以提 PR 改的。 --- DHCP Client 我仅在 Linux 上测试了,可行,绑定 0.0.0.0:0 可以免 root 运行,68 需要 root 权限。windows 卡住,也没抓包到,尚不知什么原因,如果在 MacOS、Linux、Windows 均可以,就可以考虑加入这个功能了。 ``` server dhcp # 自动寻找网卡获取 DNS nameserver 的 IP server dhcp://eth0...