use lneto.ErrDropPacket where appropiate; clean up examples/xnet output

This commit is contained in:
soypat
2025-12-31 18:15:34 -03:00
parent 243d1a720d
commit dc374169dc
7 changed files with 43 additions and 19 deletions
+2 -2
View File
@@ -43,13 +43,13 @@ func (sudp *StackUDPPort) Demux(carrierData []byte, frameOffset int) error {
}
dst := ufrm.DestinationPort()
if dst != sudp.h.port {
return nil // Not meant for us.
return lneto.ErrPacketDrop // Not meant for us.
}
// TODO remote ip address handling.
src := ufrm.SourcePort()
if sudp.rmport != 0 && src != sudp.rmport {
return nil // Not from our target remote port.
return lneto.ErrPacketDrop // Not from our target remote port.
}
err = sudp.h.demux(carrierData, frameOffset+8)
if err != nil {