[patch 03/19] [NETFILTER]: Fix CTA_PROTO_NUM attribute size in ctnetlink

From: Greg Kroah-Hartman
Date: Fri Dec 23 2005 - 17:54:29 EST


-stable review patch. If anyone has any objections, please let us know.

------------------
From: Krzysztof Oledzki <olenf@xxxxxx>

CTA_PROTO_NUM is a u_int8_t.

Based on oryginal patch by Patrick McHardy <kaber@xxxxxxxxx>

Signed-off-by: Krzysztof Piotr Oledzki <ole@xxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
net/ipv4/netfilter/ip_conntrack_netlink.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- linux-2.6.14.4.orig/net/ipv4/netfilter/ip_conntrack_netlink.c
+++ linux-2.6.14.4/net/ipv4/netfilter/ip_conntrack_netlink.c
@@ -506,7 +506,7 @@ nfattr_failure:
}

static const int cta_min_proto[CTA_PROTO_MAX] = {
- [CTA_PROTO_NUM-1] = sizeof(u_int16_t),
+ [CTA_PROTO_NUM-1] = sizeof(u_int8_t),
[CTA_PROTO_SRC_PORT-1] = sizeof(u_int16_t),
[CTA_PROTO_DST_PORT-1] = sizeof(u_int16_t),
[CTA_PROTO_ICMP_TYPE-1] = sizeof(u_int8_t),
@@ -532,7 +532,7 @@ ctnetlink_parse_tuple_proto(struct nfatt

if (!tb[CTA_PROTO_NUM-1])
return -EINVAL;
- tuple->dst.protonum = *(u_int16_t *)NFA_DATA(tb[CTA_PROTO_NUM-1]);
+ tuple->dst.protonum = *(u_int8_t *)NFA_DATA(tb[CTA_PROTO_NUM-1]);

proto = ip_conntrack_proto_find_get(tuple->dst.protonum);


--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/