-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] nftset 共用 set: netlink receive: file exists #702
Comments
现在代码也没人更新了,问题也没人解答了 @ |
不会被抓了吧 |
应该能处理一下这个nftset的错误,即使执行失败,也不应该导致解析结果不返回 |
我刚想用这个功能,因为有些ip已经在其它应用加载进来了,我再用nftset一些在mosdns认为是china_ip的,插入进去。看了你上面,应该是已经存在了,就会报错了。 |
如果 nftset 要写入的 ip 和 里面存在的 ip 不一样而且有重叠。会报错。 不建议和别的程序共用 set 。 |
跟是否共用set无关,除非添加ip时先判断是否存在,原先存在的ip也可能是mosdns在先前查询时添加的。其实只要mosdns忽略添加失败的情况就行,就算ip没加set成功,也正常返回解析结果给客户端。 |
对,我也遇到了这个问题,要不直接(改一下代码)nft set模块那边直接忽略file exists报错吧,发现是file exists报错就直接当成功 |
我改了一下,可以在release里下载我的修改版:https://github.com/am009/mosdns |
在提交之前,请确认
mosdns 版本
fix_667
操作系统
ubuntu
Bug 描述和复现步骤
在第一次启动mosdns后,第一次查询被墙域名,会返回servfail。如果取消将ip加入nftset的动作,则正常,估计是这个插件的原因
debug日志:
2023-07-29T08:33:02.234+0800 WARN udp_server entry err {"query": {"uqid": 1, "client": "::ffff:127.0.0.1", "qname": "www.google.com.", "qtype": 1, "qclass": 1, "rcode": 0, "elapsed": "583.769324ms"}, "error": "nftable: failed to add ipv4 elems [172.217.12.100/24]: conn.Receive: netlink receive: file exists"}
估计是第一次查询域名时未cache,但是添加进nft时因ip已经存在(ip已经被其他程序添加了),添加ip进nft set失败导致该错误。第二次查询因为cache命中,没有添加nftset的动作,所以查询正常。
使用的配置文件
mosdns 的 log 记录
The text was updated successfully, but these errors were encountered: