enumerating ipv4 and ipv6 address of my cards using boost asio

后端 未结 1 553
北荒
北荒 2021-02-14 00:00

I am trying to enumerate ipv4 and ipv6 addresses of all the network cards(I have 2 cards) my pc.

I am using the following code to do that.

using boost::a         


        
1条回答
  •  遇见更好的自我
    2021-02-14 00:39

    If the platform is Windows 7 SP1 the link-local interfaces are being skipped as they are tagged "SkipAsSource" by Windows which means that getaddrinfo will not return them and hence neither will Boost.

    You can try to inspect the flag with the following command:

    netsh int ipv6 show addresses level=verbose
    
    Address fe80::e0:0:0:0%14 Parameters
    ---------------------------------------------------------
    Interface Luid     : Teredo Tunneling Pseudo-Interface
    Scope Id           : 0.14
    Valid Lifetime     : infinite
    Preferred Lifetime : infinite
    DAD State          : Deprecated
    Address Type       : Other
    Skip as Source     : **true**
    

    0 讨论(0)
提交回复
热议问题