mirror of
https://github.com/golang/net.git
synced 2026-03-31 18:37:08 +09:00
dns/dnsmessage: update SVCB packing to prohibit name compression
This commit is contained in:
@@ -160,10 +160,14 @@ func (k SVCParamKey) GoString() string {
|
||||
return printUint16(uint16(k))
|
||||
}
|
||||
|
||||
func (r *SVCBResource) pack(msg []byte, compression map[string]uint16, compressionOff int) ([]byte, error) {
|
||||
func (r *SVCBResource) pack(msg []byte, _ map[string]uint16, _ int) ([]byte, error) {
|
||||
oldMsg := msg
|
||||
msg = packUint16(msg, r.Priority)
|
||||
msg, err := r.Target.pack(msg, compression, compressionOff)
|
||||
// https://datatracker.ietf.org/doc/html/rfc3597#section-4 prohibits name
|
||||
// compression for RR types that are not "well-known".
|
||||
// https://datatracker.ietf.org/doc/html/rfc9460#section-2.2 explicitly states that
|
||||
// compression of the Target is prohibited, following RFC 3597.
|
||||
msg, err := r.Target.pack(msg, nil, 0)
|
||||
if err != nil {
|
||||
return oldMsg, &nestedError{"SVCBResource.Target", err}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user