From a578fc29d7963d819770c7397c2848f815ad4e07 Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Thu, 30 Nov 2023 15:52:42 +0300 Subject: [PATCH] ipset: imp err msg --- internal/ipset/ipset_linux.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/ipset/ipset_linux.go b/internal/ipset/ipset_linux.go index 892e439b681..6bc9add19e5 100644 --- a/internal/ipset/ipset_linux.go +++ b/internal/ipset/ipset_linux.go @@ -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 } @@ -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 @@ -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 }