"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "msg_helpers.go" between
dns-1.1.47.tar.gz and dns-1.1.48.tar.gz

About: GO DNS implements a DNS library in Go.

msg_helpers.go  (dns-1.1.47):msg_helpers.go  (dns-1.1.48)
skipping to change at line 561 skipping to change at line 561
lastwindow, lastlength = window, length lastwindow, lastlength = window, length
} }
l += int(lastlength) + 2 l += int(lastlength) + 2
return l return l
} }
func packDataNsec(bitmap []uint16, msg []byte, off int) (int, error) { func packDataNsec(bitmap []uint16, msg []byte, off int) (int, error) {
if len(bitmap) == 0 { if len(bitmap) == 0 {
return off, nil return off, nil
} }
if off > len(msg) {
return off, &Error{err: "overflow packing nsec"}
}
toZero := msg[off:]
if maxLen := typeBitMapLen(bitmap); maxLen < len(toZero) {
toZero = toZero[:maxLen]
}
for i := range toZero {
toZero[i] = 0
}
var lastwindow, lastlength uint16 var lastwindow, lastlength uint16
for _, t := range bitmap { for _, t := range bitmap {
window := t / 256 window := t / 256
length := (t-window*256)/8 + 1 length := (t-window*256)/8 + 1
if window > lastwindow && lastlength != 0 { // New window, jump t o the new offset if window > lastwindow && lastlength != 0 { // New window, jump t o the new offset
off += int(lastlength) + 2 off += int(lastlength) + 2
lastlength = 0 lastlength = 0
} }
if window < lastwindow || length < lastlength { if window < lastwindow || length < lastlength {
return len(msg), &Error{err: "nsec bits out of order"} return len(msg), &Error{err: "nsec bits out of order"}
 End of changes. 1 change blocks. 
0 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)