[NETFILTER] bug: skb->protocol is already net-endian
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 3 Nov 2006 08:59:17 +0000 (00:59 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 5 Nov 2006 22:11:29 +0000 (14:11 -0800)
htons() is not needed (and no, it's not misspelled ntohs() -
userland expects net-endian here).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/nfnetlink_log.c
net/netfilter/nfnetlink_queue.c

index 00580a8187365a47f83ae7e6818e9f9fd2499e9c..b2bf8f2e01da5cb32bcb7ebb0d2dde47eb877bd9 100644 (file)
@@ -427,7 +427,7 @@ __build_packet_message(struct nfulnl_instance *inst,
        nfmsg->version = NFNETLINK_V0;
        nfmsg->res_id = htons(inst->group_num);
 
-       pmsg.hw_protocol        = htons(skb->protocol);
+       pmsg.hw_protocol        = skb->protocol;
        pmsg.hook               = hooknum;
 
        NFA_PUT(inst->skb, NFULA_PACKET_HDR, sizeof(pmsg), &pmsg);
index 8eb2473d83e1d8cf919b3ed92785f4d824e712b0..6e4ada3c1844dde85e8ef81cbe1c00a4cd834f29 100644 (file)
@@ -414,7 +414,7 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
        nfmsg->res_id = htons(queue->queue_num);
 
        pmsg.packet_id          = htonl(entry->id);
-       pmsg.hw_protocol        = htons(entskb->protocol);
+       pmsg.hw_protocol        = entskb->protocol;
        pmsg.hook               = entinf->hook;
 
        NFA_PUT(skb, NFQA_PACKET_HDR, sizeof(pmsg), &pmsg);