dhcpv6: 'network mask too short.'

David W. Hankins David_Hankins at isc.org
Fri Oct 3 20:51:39 UTC 2008


A significant number now of your fellow peers are sending email to
dhcp-bugs at isc.org to report bugs with this configuration validation
feature.  They're all really bright people who are getting caught by
something trivial.

An IPv6 prefix example:

	2001:db8:5:1000::/64

The thing that catches people is that the prefix length (64) runs left
to right, but each number between the colons _extends_ right to left.

By this I mean:

	5	->	0005
	1000	->	1000
	db8	->	0db8

So folks send us configs with:

	subnet6 2001:db8:5::/36 {
	}

Because of course '0x5' is 4 bits beyond 32 bits, so 36.

And they're surprised by this.  The surprise comes because they're
counting prefix bits from the left, but the hexadecimal grows from
the right.  They're not counting the zeroes.  The correct prefix in
this case is 48, or:

	subnet6 2001:db8:5000::/36 {
	}

If that was really what you wanted.


It may be that humans writing config files should always expand the
silent zeroes (except ::) to make counting bits-by-four easier on
themselves.  Or perhaps that syslog complaints of human errors should
perform and display the expansion (I'll work on that).

Either way, before you send bug reports on mask length config
warnings, please have dhcp-users@ check your math.  :)

-- 
Ash bugud-gul durbatuluk agh burzum-ishi krimpatul.
Why settle for the lesser evil?	 https://secure.isc.org/store/t-shirt/
-- 
David W. Hankins	"If you don't do it right the first time,
Software Engineer		     you'll just have to do it again."
Internet Systems Consortium, Inc.		-- Jack T. Hankins


More information about the dhcp-users mailing list