add zero max ports error

This commit is contained in:
soypat
2025-07-15 00:57:24 -03:00
parent ad22c61b28
commit 63dc5d1079
4 changed files with 8 additions and 0 deletions
+3
View File
@@ -27,6 +27,9 @@ type StackIP struct {
}
func (sb *StackIP) Reset(addr netip.Addr, maxNodes int) error {
if maxNodes <= 0 {
return errZeroMaxNodes
}
err := sb.SetAddr(addr)
if err != nil {
return err