Patchwork [1/3] netfilter: nfnetlink_log: fix NLA_PUT macro removal bug

login
register
mail settings
Submitter Patrick McHardy
Date Aug. 19, 2012, 8:16 p.m.
Message ID <1345407370-30009-2-git-send-email-kaber@trash.net>
Download mbox | patch
Permalink /patch/178587/
State Accepted
Headers show

Comments

Patrick McHardy - Aug. 19, 2012, 8:16 p.m.
Commit 1db20a52 (nfnetlink_log: Stop using NLA_PUT*().) incorrectly
converted a NLA_PUT_BE16 macro to nla_put_be32() in nfnetlink_log:

-               NLA_PUT_BE16(inst->skb, NFULA_HWTYPE, htons(skb->dev->type));
+               if (nla_put_be32(inst->skb, NFULA_HWTYPE, htons(skb->dev->type))

Signed-off-by: Patrick McHardy <kaber@trash.net>
---
 net/netfilter/nfnetlink_log.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Pablo Neira - Aug. 20, 2012, 2:52 p.m.
On Sun, Aug 19, 2012 at 10:16:08PM +0200, Patrick McHardy wrote:
> Commit 1db20a52 (nfnetlink_log: Stop using NLA_PUT*().) incorrectly
> converted a NLA_PUT_BE16 macro to nla_put_be32() in nfnetlink_log:
> 
> -               NLA_PUT_BE16(inst->skb, NFULA_HWTYPE, htons(skb->dev->type));
> +               if (nla_put_be32(inst->skb, NFULA_HWTYPE, htons(skb->dev->type))

queued for net tree. Thanks Patrick.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 169ab59..592091c 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -480,7 +480,7 @@  __build_packet_message(struct nfulnl_instance *inst,
 	}
 
 	if (indev && skb_mac_header_was_set(skb)) {
-		if (nla_put_be32(inst->skb, NFULA_HWTYPE, htons(skb->dev->type)) ||
+		if (nla_put_be16(inst->skb, NFULA_HWTYPE, htons(skb->dev->type)) ||
 		    nla_put_be16(inst->skb, NFULA_HWLEN,
 				 htons(skb->dev->hard_header_len)) ||
 		    nla_put(inst->skb, NFULA_HWHEADER, skb->dev->hard_header_len,