diff --git a/rule.go b/rule.go index ec4ce1f..64f3115 100644 --- a/rule.go +++ b/rule.go @@ -42,6 +42,11 @@ type Rule struct { Chain *Chain Position uint64 Handle uint64 + // The list of possible flags are specified by nftnl_rule_attr, see + // https://git.netfilter.org/libnftnl/tree/include/libnftnl/rule.h#n21 + // Current nftables go implementation supports only + // NFTNL_RULE_POSITION flag for setting rule at position 0 + Flags uint32 Exprs []expr.Any UserData []byte } @@ -136,7 +141,7 @@ func (cc *Conn) newRule(r *Rule, op ruleOperation) *Rule { flags = netlink.Request | netlink.Acknowledge | netlink.Replace | unix.NLM_F_ECHO | unix.NLM_F_REPLACE } - if r.Position != 0 { + if r.Position != 0 || (r.Flags&(1<