Skip to content

Commit

Permalink
[NETFILTER] bug: skb->protocol is already net-endian
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro authored and David S. Miller committed Nov 5, 2006
1 parent d1208b9 commit febf0a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/netfilter/nfnetlink_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/nfnetlink_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit febf0a4

Please sign in to comment.