Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Hook and Priority cannot be directly compared with predefined values

Open
#318 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
go

Research direction

Start by locating hookFromMsg, the ChainHook and ChainPriority types, and the ListChains path. Compare the requested Equals methods with returning predefined values, including handling custom Priority values. Done should make predefined hooks and priorities easier to compare while preserving custom-value checks.

Written by the indexing model from the issue text.

Description

enhancement

Hi,

When obtaining chains using methods such as ListChains, the hookFromMsg method directly returns a new pointer, which prevents it from being directly compared with defined values in the package (e.g., ChainHookPrerouting or ChainPriorityNATDest). In actual use, it is necessary to first determine whether this pointer is nil, then dereference the pointer and check if they are the same. To be honest, this is quite cumbersome. For this, I think we could add some small features:

  • Add an Equals(*ChainXXX) bool method for *ChainHook and *ChainPriority types.
  • Modify the logic of hookFromMsg to directly return the defined value instead of creating a new pointer.
  • Implement both of the above solutions to facilitate the determination of custom values (e.g., Priority).

What do you think?

Dominant language
Go
Stars
1.4k
Forks
187
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/nftables

All issues in google/nftables

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.