@@ -174,6 +174,8 @@ internal static DnsRecordBase ParseRecordFromBinary(int recordStartPosition, Dom
174
174
return new OpenPGPKeyRecord ( name , recordType , recordClass , timeToLive , resultData , recordDataPosition , recordDataLength ) ;
175
175
case RecordType . CSync :
176
176
return new CSyncRecord ( name , recordType , recordClass , timeToLive , resultData , recordDataPosition , recordDataLength ) ;
177
+ case RecordType . ZoneMD :
178
+ return new ZoneMDRecord ( name , recordType , recordClass , timeToLive , resultData , recordDataPosition , recordDataLength ) ;
177
179
case RecordType . SvcB :
178
180
return new SvcBRecord ( name , recordType , recordClass , timeToLive , resultData , recordDataPosition , recordDataLength ) ;
179
181
case RecordType . Https :
@@ -322,6 +324,8 @@ internal static DnsRecordBase ParseFromStringRepresentation(DomainName name, Rec
322
324
return new OpenPGPKeyRecord ( name , recordType , recordClass , timeToLive , origin , stringRepresentation ) ;
323
325
case RecordType . CSync :
324
326
return new CSyncRecord ( name , recordType , recordClass , timeToLive , origin , stringRepresentation ) ;
327
+ case RecordType . ZoneMD :
328
+ return new ZoneMDRecord ( name , recordType , recordClass , timeToLive , origin , stringRepresentation ) ;
325
329
case RecordType . SvcB :
326
330
return new SvcBRecord ( name , recordType , recordClass , timeToLive , origin , stringRepresentation ) ;
327
331
case RecordType . Https :
@@ -372,13 +376,13 @@ protected DomainName ParseDomainName(DomainName origin, string name)
372
376
#region Encoding
373
377
internal sealed override int MaximumLength => Name . MaximumRecordDataLength + 12 + MaximumRecordDataLength ;
374
378
375
- internal void Encode ( IList < byte > messageData , ref int currentPosition , Dictionary < DomainName , ushort > domainNames , bool useCanonical = false )
379
+ internal void Encode ( IList < byte > messageData , ref int currentPosition , Dictionary < DomainName , ushort > ? domainNames , bool useCanonical = false )
376
380
{
377
381
EncodeRecordHeader ( messageData , ref currentPosition , domainNames , useCanonical ) ;
378
382
EncodeRecordBody ( messageData , ref currentPosition , domainNames , useCanonical ) ;
379
383
}
380
384
381
- internal void EncodeRecordHeader ( IList < byte > messageData , ref int currentPosition , Dictionary < DomainName , ushort > domainNames , bool useCanonical )
385
+ internal void EncodeRecordHeader ( IList < byte > messageData , ref int currentPosition , Dictionary < DomainName , ushort > ? domainNames , bool useCanonical )
382
386
{
383
387
DnsMessageBase . EncodeDomainName ( messageData , ref currentPosition , Name , domainNames , useCanonical ) ;
384
388
DnsMessageBase . EncodeUShort ( messageData , ref currentPosition , ( ushort ) RecordType ) ;
@@ -508,17 +512,13 @@ public int CompareTo(DnsRecordBase? other)
508
512
if ( compare != 0 )
509
513
return compare ;
510
514
511
- compare = TimeToLive . CompareTo ( other . TimeToLive ) ;
512
- if ( compare != 0 )
513
- return compare ;
514
-
515
515
var thisBuffer = new byte [ MaximumRecordDataLength ] ;
516
516
int thisLength = 0 ;
517
- EncodeRecordData ( thisBuffer , ref thisLength , null , false ) ;
517
+ EncodeRecordData ( thisBuffer , ref thisLength , null , true ) ;
518
518
519
519
var otherBuffer = new byte [ other . MaximumRecordDataLength ] ;
520
520
int otherLength = 0 ;
521
- other . EncodeRecordData ( otherBuffer , ref otherLength , null , false ) ;
521
+ other . EncodeRecordData ( otherBuffer , ref otherLength , null , true ) ;
522
522
523
523
for ( int i = 0 ; i < Math . Min ( thisLength , otherLength ) ; i ++ )
524
524
{
0 commit comments