Skip to content

Commit

Permalink
[NETFILTER] conntrack_netlink: Fix endian issue with status from user…
Browse files Browse the repository at this point in the history
…space

When we send "status" from userspace, we forget to convert the endianness.
This patch adds the reqired conversion.  Thanks to Pablo Neira for
discovering this.

Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Harald Welte authored and David S. Miller committed Oct 11, 2005
1 parent b3a91d0 commit d000eaf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/netfilter/ip_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,8 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
static inline int
ctnetlink_change_status(struct ip_conntrack *ct, struct nfattr *cda[])
{
unsigned long d, status = *(u_int32_t *)NFA_DATA(cda[CTA_STATUS-1]);
unsigned long d;
unsigned status = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_STATUS-1]));
d = ct->status ^ status;

if (d & (IPS_EXPECTED|IPS_CONFIRMED|IPS_DYING))
Expand Down

0 comments on commit d000eaf

Please sign in to comment.