impl. the recent changes from the reflect package
This commit is contained in:
parent
a3bd25fad3
commit
d6716f693d
7
msg.go
7
msg.go
|
@ -360,12 +360,6 @@ func packStructValue(val reflect.Value, msg []byte, off int) (off1 int, ok bool)
|
|||
}
|
||||
case reflect.Struct:
|
||||
off, ok = packStructValue(fv, msg, off)
|
||||
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||
i := fv.Uint()
|
||||
switch fv.Type().Kind() {
|
||||
default:
|
||||
//fmt.Fprintf(os.Stderr, "dns: unknown packing type %v\n", f.Type)
|
||||
return len(msg), false
|
||||
case reflect.Uint8:
|
||||
if off+1 > len(msg) {
|
||||
//fmt.Fprintf(os.Stderr, "dns: overflow packing uint8")
|
||||
|
@ -404,7 +398,6 @@ func packStructValue(val reflect.Value, msg []byte, off int) (off1 int, ok bool)
|
|||
msg[off+4] = byte(i >> 8)
|
||||
msg[off+5] = byte(i)
|
||||
off += 6
|
||||
}
|
||||
case reflect.String:
|
||||
// There are multiple string encodings.
|
||||
// The tag distinguishes ordinary strings from domain names.
|
||||
|
|
Loading…
Reference in New Issue