@@ -298,7 +298,7 @@ func (s *SVCBMandatory) pack() ([]byte, error) {
298298
299299func (s * SVCBMandatory ) unpack (b []byte ) error {
300300 if len (b )% 2 != 0 {
301- return errors .New ("dns: svcbmandatory: value length is not a multiple of 2" )
301+ return errors .New ("bad svcbmandatory: value length is not a multiple of 2" )
302302 }
303303 codes := make ([]SVCBKey , 0 , len (b )/ 2 )
304304 for i := 0 ; i < len (b ); i += 2 {
@@ -395,10 +395,10 @@ func (s *SVCBAlpn) pack() ([]byte, error) {
395395 b := make ([]byte , 0 , 10 * len (s .Alpn ))
396396 for _ , e := range s .Alpn {
397397 if e == "" {
398- return nil , errors .New ("dns: svcbalpn: empty alpn-id" )
398+ return nil , errors .New ("bad svcbalpn: empty alpn-id" )
399399 }
400400 if len (e ) > 255 {
401- return nil , errors .New ("dns: svcbalpn: alpn-id too long" )
401+ return nil , errors .New ("bad svcbalpn: alpn-id too long" )
402402 }
403403 b = append (b , byte (len (e )))
404404 b = append (b , e ... )
@@ -413,7 +413,7 @@ func (s *SVCBAlpn) unpack(b []byte) error {
413413 length := int (b [i ])
414414 i ++
415415 if i + length > len (b ) {
416- return errors .New ("dns: svcbalpn: alpn array overflowing" )
416+ return errors .New ("bad svcbalpn: alpn array overflowing" )
417417 }
418418 alpn = append (alpn , string (b [i :i + length ]))
419419 i += length
@@ -433,13 +433,13 @@ func (s *SVCBAlpn) parse(b string) error {
433433 for p := 0 ; p < len (b ); {
434434 c , q := nextByte (b , p )
435435 if q == 0 {
436- return errors .New ("dns: svcbalpn: unterminated escape" )
436+ return errors .New ("bad svcbalpn: unterminated escape" )
437437 }
438438 p += q
439439 // If we find a comma, we have finished reading an alpn.
440440 if c == ',' {
441441 if len (a ) == 0 {
442- return errors .New ("dns: svcbalpn: empty protocol identifier" )
442+ return errors .New ("bad svcbalpn: empty protocol identifier" )
443443 }
444444 alpn = append (alpn , string (a ))
445445 a = []byte {}
@@ -449,10 +449,10 @@ func (s *SVCBAlpn) parse(b string) error {
449449 if c == '\\' {
450450 dc , dq := nextByte (b , p )
451451 if dq == 0 {
452- return errors .New ("dns: svcbalpn: unterminated escape decoding comma-separated list" )
452+ return errors .New ("bad svcbalpn: unterminated escape decoding comma-separated list" )
453453 }
454454 if dc != '\\' && dc != ',' {
455- return errors .New ("dns: svcbalpn: bad escaped character decoding comma-separated list" )
455+ return errors .New ("bad svcbalpn: bad escaped character decoding comma-separated list" )
456456 }
457457 p += dq
458458 c = dc
@@ -461,7 +461,7 @@ func (s *SVCBAlpn) parse(b string) error {
461461 }
462462 // Add the final alpn.
463463 if len (a ) == 0 {
464- return errors .New ("dns: svcbalpn: last protocol identifier empty" )
464+ return errors .New ("bad svcbalpn: last protocol identifier empty" )
465465 }
466466 s .Alpn = append (alpn , string (a ))
467467 return nil
@@ -499,14 +499,14 @@ func (*SVCBNoDefaultAlpn) len() int { return 0 }
499499
500500func (* SVCBNoDefaultAlpn ) unpack (b []byte ) error {
501501 if len (b ) != 0 {
502- return errors .New ("dns: svcbnodefaultalpn: no-default-alpn must have no value" )
502+ return errors .New ("bad svcbnodefaultalpn: no-default-alpn must have no value" )
503503 }
504504 return nil
505505}
506506
507507func (* SVCBNoDefaultAlpn ) parse (b string ) error {
508508 if b != "" {
509- return errors .New ("dns: svcbnodefaultalpn: no-default-alpn must have no value" )
509+ return errors .New ("bad svcbnodefaultalpn: no-default-alpn must have no value" )
510510 }
511511 return nil
512512}
@@ -529,7 +529,7 @@ func (s *SVCBPort) copy() SVCBKeyValue { return &SVCBPort{s.Port} }
529529
530530func (s * SVCBPort ) unpack (b []byte ) error {
531531 if len (b ) != 2 {
532- return errors .New ("dns: svcbport: port length is not exactly 2 octets" )
532+ return errors .New ("bad svcbport: port length is not exactly 2 octets" )
533533 }
534534 s .Port = binary .BigEndian .Uint16 (b )
535535 return nil
@@ -544,7 +544,7 @@ func (s *SVCBPort) pack() ([]byte, error) {
544544func (s * SVCBPort ) parse (b string ) error {
545545 port , err := strconv .ParseUint (b , 10 , 16 )
546546 if err != nil {
547- return errors .New ("dns: svcbport: port out of range" )
547+ return errors .New ("bad svcbport: port out of range" )
548548 }
549549 s .Port = uint16 (port )
550550 return nil
@@ -577,7 +577,7 @@ func (s *SVCBIPv4Hint) pack() ([]byte, error) {
577577 for _ , e := range s .Hint {
578578 x := e .To4 ()
579579 if x == nil {
580- return nil , errors .New ("dns: svcbipv4hint: expected ipv4, hint is ipv6" )
580+ return nil , errors .New ("bad svcbipv4hint: expected ipv4, hint is ipv6" )
581581 }
582582 b = append (b , x ... )
583583 }
@@ -586,7 +586,7 @@ func (s *SVCBIPv4Hint) pack() ([]byte, error) {
586586
587587func (s * SVCBIPv4Hint ) unpack (b []byte ) error {
588588 if len (b ) == 0 || len (b )% 4 != 0 {
589- return errors .New ("dns: svcbipv4hint: ipv4 address byte array length is not a multiple of 4" )
589+ return errors .New ("bad svcbipv4hint: ipv4 address byte array length is not a multiple of 4" )
590590 }
591591 b = cloneSlice (b )
592592 x := make ([]net.IP , 0 , len (b )/ 4 )
@@ -611,10 +611,10 @@ func (s *SVCBIPv4Hint) String() string {
611611
612612func (s * SVCBIPv4Hint ) parse (b string ) error {
613613 if b == "" {
614- return errors .New ("dns: svcbipv4hint: empty hint" )
614+ return errors .New ("bad svcbipv4hint: empty hint" )
615615 }
616616 if strings .Contains (b , ":" ) {
617- return errors .New ("dns: svcbipv4hint: expected ipv4, got ipv6" )
617+ return errors .New ("bad svcbipv4hint: expected ipv4, got ipv6" )
618618 }
619619
620620 hint := make ([]net.IP , 0 , strings .Count (b , "," )+ 1 )
@@ -623,7 +623,7 @@ func (s *SVCBIPv4Hint) parse(b string) error {
623623 e , b , _ = strings .Cut (b , "," )
624624 ip := net .ParseIP (e ).To4 ()
625625 if ip == nil {
626- return errors .New ("dns: svcbipv4hint: bad ip" )
626+ return errors .New ("bad svcbipv4hint: bad ip" )
627627 }
628628 hint = append (hint , ip )
629629 }
@@ -671,7 +671,7 @@ func (s *SVCBECHConfig) unpack(b []byte) error {
671671func (s * SVCBECHConfig ) parse (b string ) error {
672672 x , err := fromBase64 ([]byte (b ))
673673 if err != nil {
674- return errors .New ("dns: svcbech: bad base64 ech" )
674+ return errors .New ("bad svcbech: bad base64 ech" )
675675 }
676676 s .ECH = x
677677 return nil
@@ -699,7 +699,7 @@ func (s *SVCBIPv6Hint) pack() ([]byte, error) {
699699 b := make ([]byte , 0 , 16 * len (s .Hint ))
700700 for _ , e := range s .Hint {
701701 if len (e ) != net .IPv6len || e .To4 () != nil {
702- return nil , errors .New ("dns: svcbipv6hint: expected ipv6, hint is ipv4" )
702+ return nil , errors .New ("bad svcbipv6hint: expected ipv6, hint is ipv4" )
703703 }
704704 b = append (b , e ... )
705705 }
@@ -708,14 +708,14 @@ func (s *SVCBIPv6Hint) pack() ([]byte, error) {
708708
709709func (s * SVCBIPv6Hint ) unpack (b []byte ) error {
710710 if len (b ) == 0 || len (b )% 16 != 0 {
711- return errors .New ("dns: svcbipv6hint: ipv6 address byte array length not a multiple of 16" )
711+ return errors .New ("bas svcbipv6hint: ipv6 address byte array length not a multiple of 16" )
712712 }
713713 b = cloneSlice (b )
714714 x := make ([]net.IP , 0 , len (b )/ 16 )
715715 for i := 0 ; i < len (b ); i += 16 {
716716 ip := net .IP (b [i : i + 16 ])
717717 if ip .To4 () != nil {
718- return errors .New ("dns: svcbipv6hint: expected ipv6, got ipv4" )
718+ return errors .New ("bad svcbipv6hint: expected ipv6, got ipv4" )
719719 }
720720 x = append (x , ip )
721721 }
@@ -736,7 +736,7 @@ func (s *SVCBIPv6Hint) String() string {
736736
737737func (s * SVCBIPv6Hint ) parse (b string ) error {
738738 if b == "" {
739- return errors .New ("dns: svcbipv6hint: empty hint" )
739+ return errors .New ("bad svcbipv6hint: empty hint" )
740740 }
741741
742742 hint := make ([]net.IP , 0 , strings .Count (b , "," )+ 1 )
@@ -745,10 +745,10 @@ func (s *SVCBIPv6Hint) parse(b string) error {
745745 e , b , _ = strings .Cut (b , "," )
746746 ip := net .ParseIP (e )
747747 if ip == nil {
748- return errors .New ("dns: svcbipv6hint: bad ip" )
748+ return errors .New ("bad svcbipv6hint: bad ip" )
749749 }
750750 if ip .To4 () != nil {
751- return errors .New ("dns: svcbipv6hint: expected ipv6, got ipv4-mapped-ipv6" )
751+ return errors .New ("bad svcbipv6hint: expected ipv6, got ipv4-mapped-ipv6" )
752752 }
753753 hint = append (hint , ip )
754754 }
@@ -800,7 +800,7 @@ func (s *SVCBDoHPath) unpack(b []byte) error {
800800func (s * SVCBDoHPath ) parse (b string ) error {
801801 template , err := svcbParseParam (b )
802802 if err != nil {
803- return fmt .Errorf ("dns: svcbdohpath: %w" , err )
803+ return fmt .Errorf ("bad svcbdohpath: %w" , err )
804804 }
805805 s .Template = string (template )
806806 return nil
@@ -838,14 +838,14 @@ func (*SVCBOhttp) len() int { return 0 }
838838
839839func (* SVCBOhttp ) unpack (b []byte ) error {
840840 if len (b ) != 0 {
841- return errors .New ("dns: svcbotthp: svcbotthp must have no value" )
841+ return errors .New ("bad svcbotthp: svcbotthp must have no value" )
842842 }
843843 return nil
844844}
845845
846846func (* SVCBOhttp ) parse (b string ) error {
847847 if b != "" {
848- return errors .New ("dns: svcbotthp: svcbotthp must have no value" )
848+ return errors .New ("bad svcbotthp: svcbotthp must have no value" )
849849 }
850850 return nil
851851}
@@ -878,7 +878,7 @@ func (s *SVCBLocal) unpack(b []byte) error {
878878func (s * SVCBLocal ) parse (b string ) error {
879879 data , err := svcbParseParam (b )
880880 if err != nil {
881- return fmt .Errorf ("dns: svcblocal: svcb private/experimental key %w" , err )
881+ return fmt .Errorf ("bad svcblocal: svcb private/experimental key %w" , err )
882882 }
883883 s .Data = data
884884 return nil
0 commit comments