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

conn.Add fails on centos 7 #7

Open
rouzier opened this issue Jan 25, 2021 · 0 comments · May be fixed by #8
Open

conn.Add fails on centos 7 #7

rouzier opened this issue Jan 25, 2021 · 0 comments · May be fixed by #8

Comments

@rouzier
Copy link

rouzier commented Jan 25, 2021

I received the following error. netfilter query: netlink receive: errno 4097

Here is how to replicate it.

package main

import (
    "fmt"
    "net"
    "github.com/digineo/go-ipset"
    "github.com/ti-mo/netfilter"
)

func main() {
    conn, _ := ipset.Dial( netfilter.ProtoUnspec, nil)
    setName := "testMe"
    typeResponse, err := conn.Type("hash:ip,port", netfilter.ProtoIPv4)
    if err != nil {
        fmt.Printf("Error getting type %s: %s\n", "hash:ip,port", err.Error())
    }

    err = conn.Destroy(setName)
    err = conn.Create(setName, "hash:ip,port", typeResponse.Revision.Value, netfilter.ProtoIPv4)
    if err != nil {
        fmt.Printf("Error creating %s %s\n", setName, err.Error())
    }
    err = conn.Add(
        setName,
        ipset.NewEntry(
            ipset.EntryIP(net.ParseIP("2.1.3.4")),
            ipset.EntryProto(17),
            ipset.EntryPort(53),
        ),
    )
    conn.Close()
    if err != nil {
        fmt.Printf("Error adding %s\n", err.Error())
    }
}
@rouzier rouzier linked a pull request Jan 26, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant