do not crash if no tcp connections are desired

This commit is contained in:
Patricio Whittingslow
2025-10-22 19:19:32 -03:00
parent 407f4a08f1
commit bb4053647d
6 changed files with 19 additions and 12 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ func (ls *StackEthernet) Reset6(mac, gateway [6]byte, mtu, maxNodes int) error {
if mtu > math.MaxUint16 || mtu < 256 {
return errors.New("invalid MTU")
} else if maxNodes <= 0 {
return errZeroMaxNodes
return errZeroMaxNodesArg
}
ls.handlers = slices.Grow(ls.handlers[:0], maxNodes)
*ls = StackEthernet{