-
Notifications
You must be signed in to change notification settings - Fork 36
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
请问如何修复 "pcap init failed"? #10
Comments
你先照上面的错误排查一下。如果还有问题,请反馈。记得帖日志。 |
首先,谢谢大大百忙之中回复! |
这应该是pcap的问题,我看网上也出现过这种问题。明天我仔细瞅瞅。工作日不方便干这事
…On Fri, Jun 29, 2018 at 10:13 AM wilia ***@***.***> wrote:
首先,谢谢大大百忙之中回复!
1、我查看的这台vps的网卡就是venet0,不知道对不对
***@***.*** ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc
noqueue state UNKNOWN
link/void
inet 127.0.0.1/32 scope host venet0
inet 155.94.181.XX/32 brd 155.94.181.XX scope global venet0:0
***@***.*** ~]#
2、然后我用的是root账户,这个是确认的,因为我懒得创建普通用户再配置sudo,感觉多此一举
3、请问贴日志是贴的默认生成/var/log/rsock/rsock.log这个嘛?
如果是的话我只有这个,我运行的时候加了-v参数,可是日志还是输出这些,没有变化
2018-06-29 10:09:38.982 DEBUG [27511] ***@***.*** conf:
{"daemon": true, "log": "/var/log/rsock/rsock.log", "param":
{"cap_timeout": 10, "dev": "venet0", "duration": 600, "hash": "bt25^n1",
"keepalive": 4, "lcapIp": "155.94.181.xx", "ludp": "", "ports":
"12221-12225", "taddr": "127.0.0.1:32227", "type": "all", "unPath": ""},
"server": true, "verbose": true}
2018-06-29 10:09:38.983 DEBUG [27511] ***@***.*** filter :
((tcp[tcpflags] & tcp-syn != 0) and tcp and (ip src 155.94.181.xx) and (
src portrange 12221-12225 )) or (tcp and (ip dst 155.94.181.xx) and ( dst
portrange 12221-12225 )and (tcp[tcpflags] & (tcp-syn) == 0))
2018-06-29 10:09:38.997 ERROR [27511] ***@***.*** init failed:
arptype 65535 not supported by libpcap - falling back to cooked socket
2018-06-29 10:09:38.997 ERROR [27511] ***@***.*** pcap init
failed
2018-06-29 10:09:38.997 DEBUG [27511] ***@***.***
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Ae6H9GtxgNhF5YhCisGe432XMrvcrD39ks5uBY1OgaJpZM4U7hX9>
.
|
嗯嗯,好的,麻烦大大了。 |
你运行下tcpdump,看一下输出是什么。 tcpdump "host your_ip" |
测试过程如下: ^C |
自己下源代码手动编译试试吧。tcpdump ok的话,按理说pcap就应该支持这个网卡设备。编译指南请看这里 https://github.com/iceonsun/rsock/wiki/%E7%BC%96%E8%AF%91%E6%8C%87%E5%8D%97 如果仍然不ok的话,我现阶段也木有办法,找这个bug估计得需要一番精力 |
使用Linux/macOS里面的步骤编译的话报这个错误 |
安装libuv等依赖库没有 输入
第2步如果有输出,切输出的路径以/usr/开头。证明有安装。 |
第一个是updatedb命令嘛?updatedb可以,updatdb不行,
|
是updatedb,我打错了。 这输出不正常啊。安装了uv等库,会有uv.h等头文件啊。你ls -al /usr/include/uv*, /usr/local/include/uv*,/usr/x86-linux(大概是这样)/include/uv* 下面找一下。 |
确实不对呀,这些目录都找不到 |
这个 /usr/include/lib,以及类似的。有include的文件夹,都ls -al 输出一下 比如 ls -al /usr/include/lib/uv* |
查了下,都没有,这么看来是安装失败了吧, /usr/include/libnet: /usr/lib64/libuser: /usr/lib64/libxslt-plugins: |
这个不是有输出么/usr/include/libnet。 ls -al /usr/include/libuv 这样,换一下。 或者这样 locate uv.so locate uv.a |
只有locate uv.so有/usr/输出 |
uv没装上。 如果你会手动编译且自己愿意折腾的话,这样做做:修改CMakeLists.txt,像这行一样: https://github.com/iceonsun/rsock/blob/master/CMakeLists.txt#L8 加入 include_directories(/opt/rsock/xbuild/include/libuv/),一次加入libpcap, libnet, libdnet的。然后重新编译。如果还报错说没找文件,那就肯定是你的库没装好。 如果不愿意折腾,且客户端不是mac或者windows,就别折腾了。改用kcpraw或者udp2raw吧。不过我没试过 |
嗯,好的 |
网卡叫venet0,应该是openvz的(跟我的搬瓦工一个样)。openvz上面不支持SOCK_RAW,所以pcap fallback到了SOCK_DGRAM(也就是所谓的cooked mode):
这时pcap_datalink()返回的datalink类型就不再是 |
@wangyu- 大佬,没错我是openvz,不过不是帮瓦工,请问该怎么处理呢? |
编译的话,这次报错不是说没找到文件 |
@wilia 你自己编译解决不了,得改代码。不过改起来不难,等作者更新吧。 |
@wangyu- 嗯嗯,好的,多谢大佬提醒,我试试 udp2raw 去 |
安装号rsock后我使用以下命令
/opt/rsock/./server_rsock_Linux --dev=venet0 --taddr=127.0.0.1:32227 --ports=12221-12225
dev: venet0, ipv4: 127.0.0.1
Run in background. pid: 8226
但是在ps aux看不到进程,查看日志如下
2018-06-28 22:38:08.633 ERROR [8226] [RCap::doInit@108] init failed: arptype 65535 not supported by libpcap - falling back to cooked socket
2018-06-28 22:38:08.633 ERROR [8226] [ISockApp::doInit@211] pcap init failed
2018-06-28 22:38:08.633 DEBUG [8226] [ISockApp::Close@275]
组件安装了 libuv libnet libpcap libdnet gcc gcc-c++
The text was updated successfully, but these errors were encountered: