Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-users: Re: [Wireshark-users] specifying > 4 byte offsets / capture filters

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 8 Oct 2012 10:54:10 -0700
On Oct 8, 2012, at 10:33 AM, Stuart Kendrick <skendric@xxxxxxxxx> wrote:

> I want to capture ARP Requests/Responses around a particular MAC address (I'm looking for a rogue node intermittently impersonating this address).
> Thus, I want to filter on the ARP fields:  Sender MAC Address and Target MAC Address

	...

> Trying a simpler capture filter:
> ether[22:6]==0x001e4f3d4204
> also red
> 
> OK, so reading the documentation ... http://www.wireshark.org/docs/man-pages/pcap-filter.html ... I see that pcap permits a length of either 1, 2, or 4 ... no sixes (6).

Correct.  For filter tests, it currently only generates BPF code where the data can be tested with a single comparison instruction, which means no more than 4 bytes (the BPF pseudo-machine is a 32-bit machine).

> Can anyone think of a creative way to do the same thing?

arp and ((ether[22:4]==0x001e4f3d and ether[26:2]==0x4204) or (ether[32:4]==0x001e4f3d) and ether[36:2]==0x4204))