LivePacketDevice.AllLocalMachine throw exception with IPv6 enabled

Oct 31, 2009 at 3:58 AM

I recently bought a computer with Windows Vista 64 bit operating system with Ipv6 support enabled as default.

Running one of the very simple sample program "ObtainingTheDeviceList" from PCAP.NET's developer's pack throws exception about not supporting Ipv6.

Following the the code:

 

            // Retrieve the device list from the local machine
            IList<LivePacketDevice> allDevices = LivePacketDevice.AllLocalMachine;
            if (allDevices.Count == 0)
            {
                Console.WriteLine("No interfaces found! Make sure WinPcap is installed.");
                return;
            }
            // Print the list
            for (int i = 0; i != allDevices.Count; ++i)
            {
                LivePacketDevice device = allDevices[i];
                Console.Write((i + 1) + ". " + device.Name);
                if (device.Description != null)
                    Console.WriteLine(" (" + device.Description + ")");
                else
                    Console.WriteLine(" (No description available)");
            }

            // Retrieve the device list from the local machine

            IList<LivePacketDevice> allDevices = LivePacketDevice.AllLocalMachine;

 

            if (allDevices.Count == 0)

            {

                Console.WriteLine("No interfaces found! Make sure WinPcap is installed.");

                return;

            }

 

            // Print the list

            for (int i = 0; i != allDevices.Count; ++i)

            {

                LivePacketDevice device = allDevices[i];

                Console.Write((i + 1) + ". " + device.Name);

                if (device.Description != null)

                    Console.WriteLine(" (" + device.Description + ")");

                else

                    Console.WriteLine(" (No description available)");

            }

The first line of code "IList<LivePacketDevice> allDevices = LivePacketDevice.AllLocalMachine;" throws the exception.
By disabling Ipv6 support does help. Does anyone know of any other way to handle this?
I don't want my user to disable their Ipv6 support just to run this program.
Thanks.

 

Coordinator
Oct 31, 2009 at 9:33 AM

Hi,

 

Please copy the full exception details including the call stack and write it here and I'll try to create a fixed version.

 

Boaz.

Nov 2, 2009 at 2:02 AM

Here is the full exception message:

 

-----------------------------------------------
System.NotImplementedException was unhandled

 

  Message="Device of family Internet6 is unsupported"
  Source="PcapDotNet.Core"
  StackTrace:
       at PcapDotNet.Core.DeviceAddress..ctor(pcap_addr* pcapAddress) in c:\tfs\tfs06.codeplex.com\pcapdotnet\pcapdotnet\src\pcapdotnet.core\deviceaddress.cpp:line 61
       at PcapDotNet.Core.LivePacketDevice..ctor(pcap_if* device) in c:\tfs\tfs06.codeplex.com\pcapdotnet\pcapdotnet\src\pcapdotnet.core\livepacketdevice.cpp:line 86
       at PcapDotNet.Core.LivePacketDevice.get_AllLocalMachine() in c:\tfs\tfs06.codeplex.com\pcapdotnet\pcapdotnet\src\pcapdotnet.core\livepacketdevice.cpp:line 34
       at ObtainingTheDeviceList.Program.Main(String[] args) in F:\WC\Projects\YourthShield\Research\PcapDotNet.DevelopersPack\src\ObtainingTheDeviceList\Program.cs:line 12
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

 

System.NotImplementedException was unhandled

  Message="Device of family Internet6 is unsupported"

  Source="PcapDotNet.Core"

  StackTrace:

       at PcapDotNet.Core.DeviceAddress..ctor(pcap_addr* pcapAddress) in c:\tfs\tfs06.codeplex.com\pcapdotnet\pcapdotnet\src\pcapdotnet.core\deviceaddress.cpp:line 61

       at PcapDotNet.Core.LivePacketDevice..ctor(pcap_if* device) in c:\tfs\tfs06.codeplex.com\pcapdotnet\pcapdotnet\src\pcapdotnet.core\livepacketdevice.cpp:line 86

       at PcapDotNet.Core.LivePacketDevice.get_AllLocalMachine() in c:\tfs\tfs06.codeplex.com\pcapdotnet\pcapdotnet\src\pcapdotnet.core\livepacketdevice.cpp:line 34

       at ObtainingTheDeviceList.Program.Main(String[] args) in F:\WC\Projects\YourthShield\Research\PcapDotNet.DevelopersPack\src\ObtainingTheDeviceList\Program.cs:line 12

       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)

       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)

       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

       at System.Threading.ThreadHelper.ThreadStart()

  InnerException: 

-----------------------------------------------
If I turn off IPv6 support at "Network Connections Properties" (there is a checkbox for "Internet Protocol Version 6 (TCP/IPv6), then  everything works.
Thanks a lot!

 

 

Coordinator
Nov 6, 2009 at 7:22 PM

You are correct.

It's indeed unsupported for now.

I will add support for IPv6 devices in the next version.

 

Thank you.

Nov 7, 2009 at 1:12 AM

Sir, thank you for your kind follow up. I will be waiting for your next release with this fix.

At the meantime, do you think it is possible to have a temporary fix to at least skip IPv6 devices?

I believe it is not important to support IPv6 devices as I don't recall any active usage of such protocol yet.

For now, I have to advise my users to turn off IPv6 support at their OS before they can use my program. This is doable, but annoying...just a thought.

Thanks again.

Nov 28, 2009 at 4:30 PM

I have Windows Vista 64-bit and have unchecked the IPv6 checkbox on all three network devices (Ethernet, Wireless, and Bluetooth) that appear in my manage network connections window, but I am still receiving the "System.NotImplementedException: Device of family Internet6 is unsupported" error message.

Do you have any idea on when the next version with the change that will not throw an error message when getting the list of devices when one or more supports IPv6?

Thanks

Coordinator
Nov 28, 2009 at 6:13 PM

Hi,

Actually, in order to fully support Windows 7, the next version will use WinPcap 4.1.1.

The reason for the version delay, is due to an apparent bug in WinPcap 4.1.1 that causes a BSOD (Blue Screen Of Death) - both on Windows XP and on Windows 7.

Since I don't want to release a version that I know that can cause a BSOD (even though it's due to WinPcap and not Pcap.Net), I'm waiting for WinPcap guys to find the bug and fix it.

If you want, you can try and use the latest Pcap.Net source code files that support both Windows 7 and IPv6 devices and use WinPcap 4.1.1.

 

You can read all about the WinPcap BSOD bug in the following link:

http://www.winpcap.org/pipermail/winpcap-bugs/2009-November/001094.html

 

Boaz.

Coordinator
Mar 12, 2010 at 7:58 AM

Pcap.Net version 0.5.0 was released today.

This version supports WinPcap 4.1.1, Windows 7 (32 and 64 bits) and IPv6 devices.