mirror of
https://github.com/soypat/lneto.git
synced 2026-09-11 09:09:30 +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
@@ -26,7 +26,7 @@ const (
|
||||
// An error is returned if the buffer size is smaller than 240.
|
||||
func NewFrame(buf []byte) (Frame, error) {
|
||||
if len(buf) < OptionsOffset {
|
||||
return Frame{}, lneto.ErrShortBuffer
|
||||
return Frame{}, lneto.ErrTruncatedFrame
|
||||
}
|
||||
return Frame{buf: buf}, nil
|
||||
}
|
||||
@@ -125,7 +125,7 @@ func (frm Frame) ForEachOption(fn func(off int, opt OptNum, data []byte) error)
|
||||
// Parse DHCP options.
|
||||
ptr := OptionsOffset
|
||||
if ptr > len(frm.buf) {
|
||||
return lneto.ErrShortBuffer
|
||||
return lneto.ErrTruncatedFrame
|
||||
} else if len(frm.buf[ptr:]) == 0 {
|
||||
return lneto.ErrInvalidField
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user