-
Notifications
You must be signed in to change notification settings - Fork 138
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
bug: GetRule returns entries for all chains, not the one provided #114
Comments
Here is the relevant function https://github.com/greenpau/cni-plugins/blob/dnat/pkg/utils/get_chain_props.go |
There is another aspect for this. There is no regards as to IPv4 vs. IPv6 chains ... The filtering could happen here ... Lines 81 to 88 in 7127d9d
One other though is that perhaps |
There is no "default" handling of various "AttributeDecoder" types. Lines 288 to 306 in 7127d9d
|
Maybe a similar commit to fdd795d might be needed? Haven’t looked at it, and won’t have time to do so either, so I’ll rely on a PR to fix this. |
we can fix this problem by add a judgment at rule.go line 87:
Apart from this,we need to fix case unix.NFTA_RULE_TABLE:
r.Table = &Table{Name: ad.String()}
r.Table.Family = TableFamily(msg.Data[0]) this line is aim to return a rule's father table's net family attr, instead of return all 0 back to user, thus we could make a judgment on the protocol cluster of the target table and the obtained tables, at the end of it, we can successfully get the rules for a specific table and a specific chain. and the other fix will be push to my fork repo github.com/RandolphCYG/nftables |
Can you send your change as a pull request as well? Or is there any reason why it couldn’t be upstreamed? :) |
hey, here comes my first pull request, could you help me check it ? |
as I remember this issue happen only for old kernel eg. centos7 with 3.10-510+ with backports |
I make
GetRule()
call in the following way.The issue is I am getting back all chains, not the table and change I passed as arguments.
Here is a dump of such response, Please note the
Name: (string) (len=10) "prerouting"
andName: (string) (len=11) "postrouting",
.The text was updated successfully, but these errors were encountered: