aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/netlink.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-26 02:26:10 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-26 02:26:10 -0400
commit43154d08d6bb5c69aa0d0e3448fb348b4cd84e91 (patch)
tree176edb26aad2d33e8be36530b66b19d0603c4b1d /include/net/netlink.h
parent03194379a77b02df3404ec4848a50c6784e9a8a5 (diff)
parent289c79a4bd350e8a25065102563ad1a183d1b402 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/cpmac.c net/mac80211/mlme.c
Diffstat (limited to 'include/net/netlink.h')
-rw-r--r--include/net/netlink.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/net/netlink.h b/include/net/netlink.h
index a5506c42f03c..112dcdf7e34e 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -772,12 +772,13 @@ static inline int __nla_parse_nested_compat(struct nlattr *tb[], int maxtype,
772 const struct nla_policy *policy, 772 const struct nla_policy *policy,
773 int len) 773 int len)
774{ 774{
775 if (nla_len(nla) < len) 775 int nested_len = nla_len(nla) - NLA_ALIGN(len);
776
777 if (nested_len < 0)
776 return -1; 778 return -1;
777 if (nla_len(nla) >= NLA_ALIGN(len) + sizeof(struct nlattr)) 779 if (nested_len >= nla_attr_size(0))
778 return nla_parse_nested(tb, maxtype, 780 return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len),
779 nla_data(nla) + NLA_ALIGN(len), 781 nested_len, policy);
780 policy);
781 memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1)); 782 memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
782 return 0; 783 return 0;
783} 784}