Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f46df18 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso
Browse files

netfilter: nf_tables: fix missing byteorder conversion in policy



When fetching the policy attribute, the byteorder conversion was
missing, breaking the chain policy setting.

Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 11b57f90
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -859,7 +859,7 @@ static int nf_tables_newchain(struct sock *nlsk, struct sk_buff *skb,
		    nla[NFTA_CHAIN_HOOK] == NULL)
		    nla[NFTA_CHAIN_HOOK] == NULL)
			return -EOPNOTSUPP;
			return -EOPNOTSUPP;


		policy = nla_get_be32(nla[NFTA_CHAIN_POLICY]);
		policy = ntohl(nla_get_be32(nla[NFTA_CHAIN_POLICY]));
		switch (policy) {
		switch (policy) {
		case NF_DROP:
		case NF_DROP:
		case NF_ACCEPT:
		case NF_ACCEPT: