mirror of
https://github.com/soypat/lneto.git
synced 2026-08-29 10:59:03 +00:00
Error rewrites (#43)
* pcap: reuse Frame memory * slog: reduce heap allocations of addresses; also prevent heap alloc of dhcp options in pcap * dns: heapless improvement; add StackAsync buffer for more heapless operation; start thinking of errors * errors: begin standardise errors in lneto * errors: finish standardization of errors * fix merge issues * add more lneto errors to rest of package * format errors.go
This commit is contained in:
+3
-2
@@ -1,8 +1,9 @@
|
||||
package ntp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/soypat/lneto"
|
||||
)
|
||||
|
||||
type state uint8
|
||||
@@ -100,7 +101,7 @@ func (c *Client) Demux(carrierData []byte, frameOffset int) error {
|
||||
xmt := frm.TransmitTime()
|
||||
orig := frm.OriginTime()
|
||||
if xmt == orig || orig != c.t[0] {
|
||||
return errors.New("bogus NTP packet")
|
||||
return lneto.ErrPacketDrop
|
||||
}
|
||||
|
||||
txelapsed := c.now().Sub(c.start)
|
||||
|
||||
Reference in New Issue
Block a user