From: Al Viro Date: Fri, 3 Nov 2006 08:59:17 +0000 (-0800) Subject: [NETFILTER] bug: skb->protocol is already net-endian X-Git-Tag: v2.6.19-rc5~19^2~6 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=febf0a431e42f5a1fdb2b763273700610552ddcc;p=~shefty%2Frdma-dev.git [NETFILTER] bug: skb->protocol is already net-endian htons() is not needed (and no, it's not misspelled ntohs() - userland expects net-endian here). Signed-off-by: Al Viro Signed-off-by: David S. Miller --- diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 00580a81873..b2bf8f2e01d 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c @@ -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); diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 8eb2473d83e..6e4ada3c184 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -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);