mirror of
https://github.com/soypat/lneto.git
synced 2026-09-10 00:29:34 +00:00
Add round-robin implementation (#66)
* add handler.encapsulateNode * implement round robin handler approach * simplify round robin implementation * leave TODO * internet.node touch up * fix conflict resolve f-up * replace certain ErrShortBuffer with ErrTruncatedFrame error
This commit is contained in:
+2
-2
@@ -12,7 +12,7 @@ import (
|
||||
// with payload/options of frames to avoid panics.
|
||||
func NewFrame(buf []byte) (Frame, error) {
|
||||
if len(buf) < sizeHeaderNoVLAN {
|
||||
return Frame{buf: nil}, lneto.ErrShortBuffer
|
||||
return Frame{buf: nil}, lneto.ErrTruncatedFrame
|
||||
}
|
||||
return Frame{buf: buf}, nil
|
||||
}
|
||||
@@ -122,6 +122,6 @@ func (efrm Frame) ValidateSize(v *lneto.Validator) {
|
||||
v.AddError(lneto.ErrInvalidLengthField)
|
||||
}
|
||||
if sz == TypeVLAN && len(efrm.buf) < 18 {
|
||||
v.AddError(lneto.ErrShortBuffer)
|
||||
v.AddError(lneto.ErrTruncatedFrame)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user