Hello, Scott

>Igor:
>Yes, we should skip using subnet masks and return
>again to hard coded 254 IPs. Except, if Kaboodle sniffs an
>"alien host" (ie, a device with an IP address out of the
>Kaboodle PC's subnet range), it should ping that alien's
>class-C range as well.

I rolled back and I use now IP addresses as DWORD and not CString.
Sniffer does not work. I debugged and I saw:

CSnifferThread::EthernetFrameSniffer()
{
   device = p_pcap_lookupdev(errbuf);
/*
   device==
   0000
   ev?ce\Packet-{7E49453E-EA3B-438E-B178-A66A15D8D515}
   0000...
*/
//...
   CreateAdapterNameList(device);
}

device has four zero bytes in the beginning. Then comes some readable name.
Then CreateAdapterNameList(device) is called with the leading zeros in the
argument.

BOOL CSnifferThread::CreateAdapterNameList(char *device)
{
   temp = (WCHAR *)device;
   while (*temp != 0 )
   {
//...
     temp++;
     m_iAdapterNum++;
   }
}

Here cycle while never works because the first WCHAR is zero.
I removed the leading zeros.

-Igor

Reply via email to