Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipset creation error parsing seems broken #992

Open
bleggett opened this issue Jul 17, 2024 · 1 comment
Open

ipset creation error parsing seems broken #992

bleggett opened this issue Jul 17, 2024 · 1 comment

Comments

@bleggett
Copy link

  1. Manually create an ipset named my-special-ipset

  2. Run the following code:

	err := netlink.IpsetCreate("my-special-ipset, "hash:ip", netlink.IpsetCreateOptions{Comments: true, Replace: true, Family: family})
	log.Debugf("IPSET ERROR IS: %s", err)
	if err == nl.IPSetError(nl.IPSET_ERR_EXIST) {
 		return nil
 	}
  1. does NOT return nil, as you would expect.
  2. debug log outputs IPSET ERROR IS: file exists
@bleggett
Copy link
Author

bleggett commented Jul 17, 2024

I suspect this is the result of an early return that basically skips error mapping:

msgs, err = req.Execute(unix.NETLINK_NETFILTER, 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant