Skip to content

Commit 1158343

Browse files
Liping Zhangummakynes
authored andcommitted
netfilter: nft_fib: convert htonl to ntohl properly
Acctually ntohl and htonl are identical, so this doesn't affect anything, but it is conceptually wrong. Signed-off-by: Liping Zhang <[email protected]> Acked-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent ae0ac0e commit 1158343

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

net/ipv4/netfilter/nft_fib_ipv4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ nft_fib4_select_ops(const struct nft_ctx *ctx,
198198
if (!tb[NFTA_FIB_RESULT])
199199
return ERR_PTR(-EINVAL);
200200

201-
result = htonl(nla_get_be32(tb[NFTA_FIB_RESULT]));
201+
result = ntohl(nla_get_be32(tb[NFTA_FIB_RESULT]));
202202

203203
switch (result) {
204204
case NFT_FIB_RESULT_OIF:

net/ipv6/netfilter/nft_fib_ipv6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ nft_fib6_select_ops(const struct nft_ctx *ctx,
235235
if (!tb[NFTA_FIB_RESULT])
236236
return ERR_PTR(-EINVAL);
237237

238-
result = htonl(nla_get_be32(tb[NFTA_FIB_RESULT]));
238+
result = ntohl(nla_get_be32(tb[NFTA_FIB_RESULT]));
239239

240240
switch (result) {
241241
case NFT_FIB_RESULT_OIF:

net/netfilter/nft_fib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int nft_fib_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
8686
if ((priv->flags & (NFTA_FIB_F_SADDR | NFTA_FIB_F_DADDR)) == 0)
8787
return -EINVAL;
8888

89-
priv->result = htonl(nla_get_be32(tb[NFTA_FIB_RESULT]));
89+
priv->result = ntohl(nla_get_be32(tb[NFTA_FIB_RESULT]));
9090
priv->dreg = nft_parse_register(tb[NFTA_FIB_DREG]);
9191

9292
switch (priv->result) {

0 commit comments

Comments
 (0)