From dfcd170f9904a9235eadcb9315d9f7266337c3ce Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Fri, 4 Mar 2011 17:19:19 +0100 Subject: [PATCH] Fixes --- msg.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/msg.go b/msg.go index 2fb02155..0c0a3801 100644 --- a/msg.go +++ b/msg.go @@ -16,7 +16,7 @@ package dns import ( "os" - "fmt" +// "fmt" "reflect" "net" "rand" @@ -515,8 +515,7 @@ func unpackStructValue(val *reflect.StructValue, msg []byte, off int) (off1 int, off = off1 + int(optlen) case "NSEC": // NSEC/NSEC3 if off+1 > len(msg) { - fmt.Fprintf(os.Stderr, "dns: overflow unpacking NSEC") - // TODO(MG) dit moet beter + //fmt.Fprintf(os.Stderr, "dns: overflow unpacking NSEC") return len(msg), false } // Fix multple windows TODO(mg) @@ -525,7 +524,7 @@ func unpackStructValue(val *reflect.StructValue, msg []byte, off int) (off1 int, window := int(msg[off]) blocks := int(msg[off+1]) if off+blocks > len(msg) { - fmt.Fprintf(os.Stderr, "dns: overflow unpacking NSEC") + //fmt.Fprintf(os.Stderr, "dns: overflow unpacking NSEC") return len(msg), false } if blocks == 0 { @@ -537,7 +536,6 @@ func unpackStructValue(val *reflect.StructValue, msg []byte, off int) (off1 int, } off += 2 - fmt.Fprintf(os.Stderr, "dns: %d %d", window, blocks) for j := 0; j < blocks; j++ { b := msg[off+j] // Check the bits one by one, and set the type @@ -573,7 +571,6 @@ func unpackStructValue(val *reflect.StructValue, msg []byte, off int) (off1 int, nsec[ni] = uint16(window*256 + j*8 + 7) ni++ } - println("HALLO") } nsec = nsec[:ni] fv.Set(reflect.NewValue(nsec).(*reflect.SliceValue))