From: Harald Welte Date: Tue, 11 Oct 2005 03:52:51 +0000 (-0700) Subject: [NETFILTER] conntrack_netlink: Fix endian issue with status from userspace X-Git-Tag: v2.6.14-rc5~68^2~14 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d000eaf7720cb12cd03cd3d55f71be44357d27a9;p=linux-2.6-omap-h63xx.git [NETFILTER] conntrack_netlink: Fix endian issue with status from userspace 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 Signed-off-by: David S. Miller --- diff --git a/net/ipv4/netfilter/ip_conntrack_netlink.c b/net/ipv4/netfilter/ip_conntrack_netlink.c index b08a432efcf..eade2749915 100644 --- a/net/ipv4/netfilter/ip_conntrack_netlink.c +++ b/net/ipv4/netfilter/ip_conntrack_netlink.c @@ -833,7 +833,8 @@ out: 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))