DNS working!

This commit is contained in:
soypat
2025-07-12 12:34:20 -03:00
parent a257becf15
commit 68c4d1ea71
5 changed files with 96 additions and 42 deletions
+1 -1
View File
@@ -148,6 +148,7 @@ func (sb *StackIP) Encapsulate(carrierData []byte, frameOffset int) (int, error)
id := internal.Prand16(seed)
ifrm.SetID(id)
ifrm.SetFlags(dontFrag)
ifrm.SetTTL(64)
*ifrm.SourceAddr() = sb.ip
sb.ipID = id
for i := range sb.handlers {
@@ -166,7 +167,6 @@ func (sb *StackIP) Encapsulate(carrierData []byte, frameOffset int) (int, error)
}
totalLen := n + headerlen
ifrm.SetTotalLength(uint16(totalLen))
ifrm.SetTTL(64)
ifrm.SetProtocol(proto)
ifrm.SetCRC(ifrm.CalculateHeaderCRC())
// Calculate CRC for our newly generated packet.