Update knftables to v0.0.16

Signed-off-by: Nadia Pinaeva <n.m.pinaeva@gmail.com>
This commit is contained in:
Nadia Pinaeva
2024-04-02 10:36:29 +02:00
parent f4e246bc93
commit 20bd3dd774
14 changed files with 366 additions and 33 deletions

View File

@@ -33,7 +33,8 @@ type nftablesError struct {
// wrapError wraps an error resulting from running nft
func wrapError(err error) error {
nerr := &nftablesError{wrapped: err, msg: err.Error()}
if ee, ok := err.(*exec.ExitError); ok {
ee := &exec.ExitError{}
if errors.As(err, &ee) {
if len(ee.Stderr) > 0 {
nerr.msg = string(ee.Stderr)
eol := strings.Index(nerr.msg, "\n")