Set with key type nftables.TypeIFName not working
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go, linux
- Domain
- networking, operating-systems
Research direction
Start with the Go entry points AddSet, GetSetByName, SetAddElements, and Flush, using the provided TypeIFName examples as a reproduction. Compare the package-created set and manually created set after adding "wg0" or "wg1"; done means interface-name elements are stored and added without the invalid-argument error.
Written by the indexing model from the issue text.
Description
Creating a set with Type: nftables.TypeIFName seems to work, but the set acts strangely.
Sample code for set:
conn.AddSet(&nftables.Set{
Table: table,
Name: "test_set",
KeyType: nftables.TypeIFName,
}, nil)
I also created a set called "manual_set" manually, and they both list:
nftables pkg set and nft cli set
% nft 'add set test_table manual_set { type ifname; }'
% nft list table test_table
table ip test_table {
set test_set {
type ifname
}
set manual_set {
type ifname
}
}
I then added an element into each set using nft cli and they both seem to succeed, however the set created by this package shows empty elements.
Added Elements
% nft 'add element test_table test_set { "wg0" }'
% nft 'add element test_table manual_set { "wg0" }'
% nft list table test_table ☸ kubernetes-admin@50w_k8s:argocd
table ip test_table {
set test_set {
type ifname
elements = { "" }
}
set manual_set {
type ifname
elements = { "wg0" }
}
}
Additionally, trying to add an element through this package fails for either table, though I do wonder if I've missed something in my code:
Attempt to add set element to both tables
// github.com/google/nftables set and manual set
testSet, _ := c.GetSetByName(table, "test_set")
manualSet, _ := c.GetSetByName(table, "manual_set")
// Second Element
elements := []nftables.SetElement{{Key: []byte("wg1")}}
c.SetAddElements(manualSet, elements)
c.SetAddElements(testSet, elements)
if err := c.Flush(); err != nil {
log.Panicf("Error: %s", err)
}
Running returns error: "conn.Receive: netlink receive: invalid argument"
I've tried a few different key types and have only had success with TypeFamilyIPv4.
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 187
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/nftables
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
-
Multiple Netlink Decode Paths Can Panic on Malformed or Undersized InputPossibly taken @vulragrag-star claimed this 33 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 68/100
-
New Tag release.Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
Similar issues
-
bug raised-by:verifier
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
medici-finance/assay#4177 ·
Maintainers usually reply within 1 day
-
bug: admin user creation silently ignores rolePossibly taken @bfs2021 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
eugenioenko/autentico#553 ·
Maintainers usually reply within 1 day
-
sidecar: --moriio-parallel-dispatch omits remote_request_id, so a vLLM NixlPushConnector decode dies with KeyErrorPossibly taken @xintin claimed this today. Openkind/bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
llm-d/llm-d-router#3607 ·
Maintainers usually reply within 1 day
-
automation models
Difficulty 1/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day