gpt4 book ai didi

linux - 什么是 (PF_INET,SOCK_PACKET) 的正确替代品

转载 作者:太空宇宙 更新时间:2023-11-04 09:55:07 24 4
gpt4 key购买 nike

我有一个任务要消除

<app> uses obsolete (PF_INET,SOCK_PACKET)

来自用户空间客户端的警告。如果这种类型的使用已经过时;此任务的正确、类似的替代方法是什么?

编辑:这里有误导性信息。

最佳答案

检查 man 7 packetman 7 ip了解更多信息,但看起来您需要的是

socket(PF_PACKET, SOCK_RAW, <protocol>)

"For compatibility with Linux 2.0, the obsolete socket(PF_INET,
SOCK_RAW, protocol) syntax is still supported to open a
packet(7) socket. This is deprecated and should be replaced by
socket(PF_PACKET, SOCK_RAW, protocol) instead. The main
difference is the new sockaddr_ll address structure for generic
link layer information instead of sockaddr_pkt." - ip(7)

虽然我不知道可能需要进行哪些额外更改。

关于linux - 什么是 (PF_INET,SOCK_PACKET) 的正确替代品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6060550/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com