Skip to content

Commit

Permalink
ipset: imp err msg
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Nov 30, 2023
1 parent c4673f7 commit a578fc2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/ipset/ipset_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ func newManagerWithDialer(ipsetConf []string, dial dialer) (mgr Manager, err err
return nil, fmt.Errorf("getting ipsets: %w", err)
}

log.Debug("ipset: initialized")

return m, nil
}

Expand Down Expand Up @@ -451,7 +453,7 @@ func (m *manager) addIPs(host string, set props, ips []net.IP) (n int, err error

err = conn.Add(set.name, entries...)
if err != nil {
return 0, fmt.Errorf("adding %q%s to ipset %q: %w", host, ips, set.name, err)
return 0, fmt.Errorf("adding %q%s to %q %q: %w", host, ips, set.name, set.typeName, err)
}

// Only add these to the cache once we're sure that all of them were
Expand Down Expand Up @@ -487,10 +489,10 @@ func (m *manager) addToSets(
return n, err
}
default:
return n, fmt.Errorf("unexpected family %s for ipset %q", set.family, set.name)
return n, fmt.Errorf("%q %q unexpected family %q", set.name, set.typeName, set.family)
}

log.Debug("ipset: added %d ips to set %s", nn, set.name)
log.Debug("ipset: added %d ips to set %q %q", nn, set.name, set.typeName)

n += nn
}
Expand Down

0 comments on commit a578fc2

Please sign in to comment.