将ipv6 slaac地址绑定到Windows IP堆栈错误10049 [英] Binding an ipv6 slaac address to windows IP Stack error 10049

查看:192
本文介绍了将ipv6 slaac地址绑定到Windows IP堆栈错误10049的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:

这是对bind的调用第二次停止我的项目的开发进度.第一次是为任何未知环境选择套接字接口 . bind是当时的错误,其不透明的源代码不允许我看到虚假的Hyper-V接口.我实现了Remy Lebeau的建议,即使用 GetAdaptersAddresses 循环浏览适配器接口以获得所需的条目.由于我创建的是ipv6 slaac ip地址,因此接下来实现了 RFC7217 .这将产生如下地址:2600:8806:2700:115:617e:7efc:2e2a:31cc其中network id(前8个字节)是标准地址,来自

This is the 2nd time a call to bind has stopped my project's dev progress. The first time was Selecting a socket interface for any unknown environment. bind was the perceived fault then, its opaque source code not allowing me to see the spurious Hyper-V interface. I implemented Remy Lebeau's suggestion of using GetAdaptersAddresses to cycle through the adapter interfaces to get the desired entry. Since I am creating an ipv6 slaac ip address, I next implemented RFC7217. This produces an address like this: 2600:8806:2700:115:617e:7efc:2e2a:31cc where the network id, the first 8 bytes, is standard and comes from the Router Advertisement and the 'interface id', the latter 8 bytes, is what RFC7217 tells you how to make. I am able to create the socket object for the created address without a problem.

问题:

但是当我尝试bind地址时,出现错误 WSAEADDRNOTAVAIL(10049):

But when I try to bind the address, I get error WSAEADDRNOTAVAIL (10049):

所请求的地址在其上下文中无效.如果name参数所指向的指定地址不是此计算机上的有效本地IP地址,则会返回此错误.

The requested address is not valid in its context. This error is returned if the specified address pointed to by the name parameter is not a valid local IP address on this computer.

间接地,这意味着bind正在工作.这只是意味着Windows从未见过该地址,因为ISP并未给出该地址.但这就是SLAAC地址的本质.

Indirectly, this means bind is working. It just means that windows has never seen the address before since it wasn't given out by the ISP. But that is the very nature of SLAAC addresses.

问题:

我应该如何进行操作,以使Windows能够识别我的slaac地址,否则我将无法拨打Listen呼叫?还有其他人通过其他方式解决了这个问题吗?

How should I proceed so that windows can recognize my slaac address without which I cannot make the Listen call? Is there someone else who has worked through this problem, perhaps another way?

尝试1:

拨打 CreateUnicastIpAddressEntry .不幸的是,此调用要求该应用具有 administrator 特权.我在Microsoft开发人员社区中提出了这样的建议:以用户身份而不是管理员身份调用CreateUnicastIpAddressEntry函数.

Make a call to CreateUnicastIpAddressEntry. Unfortunately, this call requires the app to have administrator privileges. I suggested this in Microsoft's Developer Community: Call the CreateUnicastIpAddressEntry function as user instead of as administrator.

我现在已经运行了MS示例程序(请参阅在CreateUnicastIpAddressEntry之后无法访问GetUnicastIpAddressEntry ).该功能可以正常工作,但是在检索ipv6 addr时存在问题.成功输入后, bind()仍然不起作用.

I have now run the MS sample programs (see Unable to GetUnicastIpAddressEntry after CreateUnicastIpAddressEntry). The functions work, but there is a problem in retrieving the ipv6 addr. bind() still does not work after a successful entry.

进一步的测试表明,Bind()仍无法建立以太网连接.请参阅 bind()适用于ipv6无线适配器接口,但不适用于ipv6以太网(错误10049).再次,由于Microsoft对未记录的__imp_bind函数的黑匣子调用,一个简单的调试问题实际上变得不可克服.

Further testing revealed that Bind() is still failing for ethernet connections. See bind() works for ipv6 wireless adapter interface but not for ipv6 ethernet (error 10049). Once again a simple debugging problem becomes practically insurmountable due to Microsoft's black-box call to the undocumented __imp_bind function.

结论:

ipv6 slaac地址的网络ID来自ISP,它通过路由器来自ISP,因此这不是安全威胁.其接口ID不可破解.该地址不存在安全风险,因此不应受到管理员特权的限制.

An ipv6 slaac address's network id comes from the ISP via the router and is therefore not a security threat. Its interface id is un-crackable. The address presents no security risk and therefore should not be subjected to the administrator privilege requirement.

推荐答案

在解决

In the process of resolving the Unable to GetUnicastIpAddressEntry after CreateUnicastIpAddressEntry posting, it was verified that bind() and listen() can indeed be made to work for RFC7217 IPv6 SLAAC generated addresses. See its Answer.

这篇关于将ipv6 slaac地址绑定到Windows IP堆栈错误10049的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆