pcap_lookupnet returns incorrect IP address

前端 未结 1 1113
小蘑菇
小蘑菇 2021-01-22 07:09

Following example code from the libpcap documentation yields the following code which should report the IP address of the given interface (eth0 in this case) [Error checking omi

相关标签:
1条回答
  • 2021-01-22 07:30

    Your statement "which should report the IP address of the given interface" is incorrect.

    From the manpage:

    pcap_lookupnet() is used to determine the IPv4 network number and mask associated with the network device device. Both netp and maskp are bpf_u_int32 pointers.

    are you sure you have a network number of 10.0.0.107 or 192.168.1.100 respectively? Sounds rather unusual.

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