Skip to content

Commit

Permalink
[NETFILTER]: SNMP NAT: fix byteorder confusion
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jul 25, 2006
1 parent 72b5582 commit 8cf8fb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/netfilter/ip_nat_snmp_basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1255,9 +1255,9 @@ static int help(struct sk_buff **pskb,
struct udphdr *udph = (struct udphdr *)((u_int32_t *)iph + iph->ihl);

/* SNMP replies and originating SNMP traps get mangled */
if (udph->source == ntohs(SNMP_PORT) && dir != IP_CT_DIR_REPLY)
if (udph->source == htons(SNMP_PORT) && dir != IP_CT_DIR_REPLY)
return NF_ACCEPT;
if (udph->dest == ntohs(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL)
if (udph->dest == htons(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL)
return NF_ACCEPT;

/* No NAT? */
Expand Down

0 comments on commit 8cf8fb5

Please sign in to comment.