netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for 3.13 0/1] nft: reject: fix endianess
@ 2013-12-12  7:51 Eric Leblond
  2013-12-12  7:51 ` [PATCH] netfilter: nft: fix endianness in dump function Eric Leblond
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Leblond @ 2013-12-12  7:51 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel


Hello,

Here's a small fix for 3.13. I'm not sure it is necessary but
getting it in 3.13 will avoid us some possible backward
compatibility issues later.

BR,
--
Eric

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] netfilter: nft: fix endianness in dump function
  2013-12-12  7:51 [PATCH for 3.13 0/1] nft: reject: fix endianess Eric Leblond
@ 2013-12-12  7:51 ` Eric Leblond
  2013-12-12  8:41   ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Leblond @ 2013-12-12  7:51 UTC (permalink / raw)
  To: pablo; +Cc: netfilter-devel, Eric Leblond

The dump function in nft_reject_ipv4 was not converting a u32
field to network order before sending it to userspace.

Signed-off-by: Eric Leblond <eric@regit.org>
---
 net/ipv4/netfilter/nft_reject_ipv4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/netfilter/nft_reject_ipv4.c b/net/ipv4/netfilter/nft_reject_ipv4.c
index fff5ba1..4a5e94a 100644
--- a/net/ipv4/netfilter/nft_reject_ipv4.c
+++ b/net/ipv4/netfilter/nft_reject_ipv4.c
@@ -72,7 +72,7 @@ static int nft_reject_dump(struct sk_buff *skb, const struct nft_expr *expr)
 {
 	const struct nft_reject *priv = nft_expr_priv(expr);
 
-	if (nla_put_be32(skb, NFTA_REJECT_TYPE, priv->type))
+	if (nla_put_be32(skb, NFTA_REJECT_TYPE, htonl(priv->type)))
 		goto nla_put_failure;
 
 	switch (priv->type) {
-- 
1.8.5.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] netfilter: nft: fix endianness in dump function
  2013-12-12  7:51 ` [PATCH] netfilter: nft: fix endianness in dump function Eric Leblond
@ 2013-12-12  8:41   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2013-12-12  8:41 UTC (permalink / raw)
  To: Eric Leblond; +Cc: netfilter-devel

On Thu, Dec 12, 2013 at 08:51:59AM +0100, Eric Leblond wrote:
> The dump function in nft_reject_ipv4 was not converting a u32
> field to network order before sending it to userspace.

Good catch. I've been reviewing other but I haven't seen any similar
endianess issue.

Applied to the nf tree, thanks Eric.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-12-12  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-12  7:51 [PATCH for 3.13 0/1] nft: reject: fix endianess Eric Leblond
2013-12-12  7:51 ` [PATCH] netfilter: nft: fix endianness in dump function Eric Leblond
2013-12-12  8:41   ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).