kaitoy / pcap4j

A Java library for capturing, crafting, and sending packets.

Home Page:https://www.pcap4j.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

windows + npcap + Loopback Adapter=> "Failed to retrieve the link layer address" error

ohuseyinoglu opened this issue · comments

Whenever any API entry point to list/iterate network interfaces (like Pcaps.findAllDevs() or Pcaps.getDevByName()), is used, apparently a PcapNetworkInterface object would be constructed (for each? interface), and when it calls getMacAddress we run into this error.

I'm not sure if any real MAC address would be assigned to the loopback adapter, so this may somewhat be an "expected error", but it pollutes the logs, and causes unnecessary concern by users.

So, my suggestion is, (if a MAC address for a loopback adapter is not meaningful anyway), do not make to call to get/set mac address of the loopback NIF (and avoid logging this unnecessary error).

(Since I'm not familiary with the PacketRequest() API of <packet.dll>, I cannot speculate much on the expected behavior here).

Forgot the add this: This may have started with a particular version of npcap (started seeing this after a long time with no errors), but unfortunately I don't have the test environment now, to play around with different versions to check.
Environment: Win7 + Npcap version 1.00, based on libpcap version 1.9.1 + JDK 1.8 + Pcap4j 1.7.4 (with minor changes)

Did you resolve this issue? If yes, could you please let me know how? Thank you.

(Assuming you were asking me - the reporter of the issue (and not the owner/developer of the project)) No, I still don't have any resolution/workaround for this problem.

(Assuming you were asking me - the reporter of the issue (and not the owner/developer of the project)) No, I still don't have any resolution/workaround for this problem.

Yes. I was asking you. Thank you. I'm facing the same issue.