gpt4 book ai didi

c - Linux C IPv6 原始套接字 - 告诉套接字不要分配流标签

转载 作者:太空狗 更新时间:2023-10-29 11:41:17 24 4
gpt4 key购买 nike

我正在尝试使用 IPv6 原始套接字发送内容。出于某种原因,我需要 IPv6 流标签为空。 Linux 似乎在用户未设置时分配随机流标签。

我发现的是 IPV6_FLOWLABEL_MGRIPV6_FLOWINFO_SEND。通过将 IPV6_FLOWINFO_SEND 设置为 true,我能够使用带有 in6_flowlabel_reqIPV6_FLOWLABEL_MGR 自己分配标签。

但是,我找不到禁用自动分配行为的选项。我尝试手动将标签设置为 0 - 但当用户将标签设置为 0 时,Linux 为其分配了一个新标签。

我错过了什么吗?

最佳答案

参见 sysctl :

/proc/sys/net/ipv6/auto_flowlabels - INTEGER
Automatically generate flow labels based on a flow hash of the
packet. This allows intermediate devices, such as routers, to
identify packet flows for mechanisms like Equal Cost Multipath
Routing (see RFC 6438).
0: automatic flow labels are completely disabled
1: automatic flow labels are enabled by default, they can be
disabled on a per socket basis using the IPV6_AUTOFLOWLABEL
socket option
2: automatic flow labels are allowed, they may be enabled on a
per socket basis using the IPV6_AUTOFLOWLABEL socket option
3: automatic flow labels are enabled and enforced, they cannot
be disabled by the socket option
Default: 1

关于c - Linux C IPv6 原始套接字 - 告诉套接字不要分配流标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48310068/

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