(please don't start a new thread by replying to a previous unrelated
posting. It messes up threaded email clients and the web-mail archive).

Jinhai Yang said:

> I'm looking at set up proper filter rules for an
> adapter with two IP addresses. My question is: Does
> winpcap work with adapter with multiple IP addresses? 
>
> I looked at the code, seems to me pcap_lookupnet() and
> pcap_compile() both assume one IP address per adapter.

Yes, pcap_lookupnet() returns only the 1st address. It says so 
plainly in the comment in inet.c:
  We need only the first IPv4 address, so we must scan the array returned 
  by PacketGetNetInfo() in order to skip non IPv4 (i.e. IPv6 addresses).

You can probably circumvent this by calling PacketGetNetInfoEx() and
extract the correct address before calling pcap_compile().

But are you sure Windows doesn't create two devices in this case?
(one for each address. The 2nd being some pseudo device one can use
to route through to the 1st device. I know it does that for Terredo/IPv6
tunneling).

PS. What would be the proper description of such a box? I thought
"multihomed" means a box with >1 adapter and 1 address each. Is
this a multihomed box too?

--gv



==================================================================
 This is the WinPcap users list. It is archived at
 http://www.mail-archive.com/[EMAIL PROTECTED]/

 To unsubscribe use 
 mailto: [EMAIL PROTECTED]
==================================================================

Reply via email to