> Package: ipset > Version: 6.30-2 > Severity: normal > > Dear Maintainer, > > When adding an entry to an ipset, if you do not specify a full dotted quad, > what gets added is not what you might reasonably expect > > For example, if you were to type: > > ipset add FOO 192.168/16 > > where FOO is the name of an existing inet family hash:ip set what it adds > is 192.0.0.0/16 - as though treating the 168 as 0.0.168, perhaps.
192.168/16 is indeed interpreted as 192.0.0.168/16. This is done intentionally by inet_aton(), which allows IP addresses in the formats 'a.b.c.', 'a.b.c', 'a.b' and 'a' [1]. An *expired* IETF draft [2] mentions that behaviour as "non-standard" but "very popular" and "a de facto standard for the textual representation of IPv4 addresses". [2] According to Wikipedia "No formal specification of this textual IP address representation exists." [3] So I would say it's a feature, not a bug, and there's nothing wrong here. [1] https://linux.die.net/man/3/inet_aton [2] https://tools.ietf.org/html/draft-main-ipaddr-text-rep-02 [3] https://en.wikipedia.org/wiki/Dot-decimal_notation