Subject: Re: [DNSOP] draft-ietf-dnsop-edns-client-subnet-01

From: Mark Andrews <[email-masked]>
Date: Fri, 12 Jun 2015 12:28:46 +1000

Mark Andrews writes:
> 
> In message <[email-masked]>, Dave Lawrence writes:
> > Tony Finch writes:
> > > Wouldn't it be much simpler to use the normal fixed address length, so
> > > that serializers and parsers can just choose a bcopy based on the address
> > > family?
> > 
> > Simple in its way, yes, but of course there still has to be packet
> > parsing checks based on declared lengths.  That's where I'm not seeing
> > that SHOULD versus MUST is making any sort of meaningful
> > implementation complexity difference.
> > 
> > Also, when every byte counts for possibly having to end up doing tcp
> > fallback, saving one might make a difference of not having to do that.
> 
> bytes = (bits + 7) / 8
 
The is what you do for MUST.

if (bytes != length)
	FORMERR;

> /* check lsb bits are zero */
> if (bits % 8 != 0) {
> 	mask = ~0 << (8 - bits % 8);
> 	if ((x[bytes - 1] & mask) != x[bytes - 1])
> 		FORMERR;
> }
> 
> /* check additional octets allowed by SHOULD are zero */
> for (i = bytes; i < length; i++)
> 	if (x[i] != 0)
> 		FORMERR;
> 
> > _______________________________________________
> > DNSOP mailing list
> > [email-masked]
> > https://www.ietf.org/mailman/listinfo/dnsop
> -- 
> Mark Andrews, ISC
> 1 Seymour St., Dundas Valley, NSW 2117, Australia
> PHONE: +61 2 9871 4742                 INTERNET: [email-masked]
-- 
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: [email-masked]