Wireshark mailing list archives
Re: Short ipv4 addresses in filter
From: Jakub Zawadzki <darkjames-ws () darkjames pl>
Date: Fri, 3 Jun 2011 22:52:54 +0200
On Fri, Jun 03, 2011 at 01:15:06PM -0700, Guy Harris wrote:
To quote his ethereal-dev message:Here is a fix to catch incomplete dotted-quad IP addresses that may lead into more surprises than necessary. In run into a problem when trying to use CIDR notation with shorthand 130.230/16. Ethereal did not complain, but did not show any matches either. After some debugging I found out that since inet_aton() was involved, the address became 0x820000e6. This behavior seems to be a leftover from the classful days when using an address like "18.5" was treated as net.host and turned automagically into 18.0.0.5. Here is a patch for epan/resolv.c:get_host_ipaddr() which catches incomplete dotted IP addresses.
Thanks, Rule of least surprise is good. It's better to use longer notation than to be surprised. Regards. ___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Short ipv4 addresses in filter Jakub Zawadzki (Jun 03)
- Re: Short ipv4 addresses in filter Jakub Zawadzki (Jun 03)
- Re: Short ipv4 addresses in filter Guy Harris (Jun 03)
- Re: Short ipv4 addresses in filter Jakub Zawadzki (Jun 03)
- Re: Short ipv4 addresses in filter Guy Harris (Jun 03)
- Re: Short ipv4 addresses in filter Jakub Zawadzki (Jun 03)