use maximum bitmap length

This commit is contained in:
Miek Gieben 2012-02-28 21:06:11 +01:00
parent a38a7311a0
commit 8220a1b148
2 changed files with 8 additions and 7 deletions

View File

@ -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

View File

@ -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 {