diff --git a/TODO.markdown b/TODO.markdown index 83142d7f..63c86049 100644 --- a/TODO.markdown +++ b/TODO.markdown @@ -10,7 +10,10 @@ need to be fixed. * Add tsig check in 'q'? * Tsig is handled in the library, api for querying tsig status * Query source address? -* TEST nsec with TYPE65534 + +* NSECx bitmap length + array of 256 block lens set to 0. scan RRs, save highest RR / 8 in + each block. len is 2 * # non-0 blocks + sum block len ## Examples to add diff --git a/types.go b/types.go index 3cd6d183..9abb8e68 100644 --- a/types.go +++ b/types.go @@ -642,9 +642,8 @@ func (rr *RR_NSEC) String() string { func (rr *RR_NSEC) Len() int { l := len(rr.NextDomain) + 1 - return rr.Hdr.Len() + l + len(rr.TypeBitMap) + 10 - // TODO: + 10 is only there to be sure we have enough - // This is also shorter due to the windowing + return rr.Hdr.Len() + l + 32 + // TODO: +32 is max type bitmap } type RR_DS struct { @@ -859,9 +858,8 @@ func (rr *RR_NSEC3) String() string { } func (rr *RR_NSEC3) Len() int { - return rr.Hdr.Len() + 6 + len(rr.Salt)/2 + 1 + len(rr.NextDomain) + 1 + len(rr.TypeBitMap) + 10 - // +10, see TODO for NSEC - // TODO: typebitmap length + return rr.Hdr.Len() + 6 + len(rr.Salt)/2 + 1 + len(rr.NextDomain) + 1 + 32 + // TODO: +32 is MAX type bit map } type RR_NSEC3PARAM struct {