aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2006-05-19 05:17:18 -0400
committerDavid S. Miller <davem@davemloft.net>2006-05-19 05:17:18 -0400
commitee433530d96a7b0af24ab616e5b51f1d89f9ae38 (patch)
treeef97ce3211d8a034a24de86a06741e662be2c27e
parent2c8ac66bb2ff89e759f0d632a27cc64205e9ddd9 (diff)
[NETFILTER]: nfnetlink_log: fix byteorder confusion
flags is a u16, so use htons instead of htonl. Also avoid double conversion. Noticed by Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/netfilter/nfnetlink_log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index c60273cad778..61cdda4e5d3b 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -321,7 +321,7 @@ static int
321nfulnl_set_flags(struct nfulnl_instance *inst, u_int16_t flags) 321nfulnl_set_flags(struct nfulnl_instance *inst, u_int16_t flags)
322{ 322{
323 spin_lock_bh(&inst->lock); 323 spin_lock_bh(&inst->lock);
324 inst->flags = ntohs(flags); 324 inst->flags = flags;
325 spin_unlock_bh(&inst->lock); 325 spin_unlock_bh(&inst->lock);
326 326
327 return 0; 327 return 0;
@@ -902,7 +902,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
902 if (nfula[NFULA_CFG_FLAGS-1]) { 902 if (nfula[NFULA_CFG_FLAGS-1]) {
903 u_int16_t flags = 903 u_int16_t flags =
904 *(u_int16_t *)NFA_DATA(nfula[NFULA_CFG_FLAGS-1]); 904 *(u_int16_t *)NFA_DATA(nfula[NFULA_CFG_FLAGS-1]);
905 nfulnl_set_flags(inst, ntohl(flags)); 905 nfulnl_set_flags(inst, ntohs(flags));
906 } 906 }
907 907
908out_put: 908out_put: