Fix adapter setup and no longer panics on packets shorter than IP header

This commit is contained in:
Neil Alexander 2019-03-28 09:12:00 +00:00
parent 0b494a8255
commit 0715e829c2
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
3 changed files with 18 additions and 7 deletions

View file

@ -29,7 +29,8 @@ type adapterImplementation interface {
}
// Initialises the adapter.
func (adapter Adapter) Init(config *config.NodeState, log *log.Logger, send chan<- []byte, recv <-chan []byte) {
func (adapter *Adapter) Init(config *config.NodeState, log *log.Logger, send chan<- []byte, recv <-chan []byte) {
log.Traceln("Adapter setup - given channels:", send, recv)
adapter.Send = send
adapter.Recv = recv
adapter.Reconfigure = make(chan chan error, 1)