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

Wireshark-dev: Re: [Wireshark-dev] Short ipv4 addresses in filter

From: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
Date: Fri, 3 Jun 2011 22:05:32 +0200
On Fri, Jun 03, 2011 at 09:54:19PM +0200, Jakub Zawadzki wrote:
> Any reason why display filter don't accept e.g. ip.addr == 10.0/8 ?
> 
> I track it down to get_host_ipaddr():
> #v+
>     if (!inet_aton(host, &ipaddr)) {
>  		/* ... */
> 	} else {
> 		/* Does the string really contain dotted-quad IP?
> 		 * Check against inet_atons that accept strings such as
> 		 * "130.230" as valid addresses and try to convert them
> 		 * to some form of a classful (host.net) notation.
> 		 */
> 		unsigned int a0, a1, a2, a3;
> 		if (sscanf(host, "%u.%u.%u.%u", &a0, &a1, &a2, &a3) != 4)
> 			return FALSE;
> 	}
> #v-

Commited in r4854[1]
>> Author: guy
>> Date:   Sun Mar 3 21:42:54 2002 +0000
>> From Heikki Vatiainen: make "get_host_ipaddr()" require dotted-quad IP
>> addresses to really be quads, i.e. have four numbers.

[1] http://anonsvn.wireshark.org/viewvc?revision=4854&view=revision