Re: Fwd: [Bug 447812] New: Netlink messages from "tc" to sch_netem module are not interpreted correctly

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Stephen Hemminger <shemminger@...>
Cc: Dave Jones <davej@...>, <netdev@...>
Date: Wednesday, May 21, 2008 - 8:21 pm

* Stephen Hemminger <shemminger@vyatta.com> 2008-05-21 15:10

Could you try this patch?

Index: net-2.6/include/net/netlink.h
===================================================================
--- net-2.6.orig/include/net/netlink.h	2008-05-22 02:12:48.000000000 +0200
+++ net-2.6/include/net/netlink.h	2008-05-22 02:15:25.000000000 +0200
@@ -772,12 +772,13 @@
 					    const struct nla_policy *policy,
 					    int len)
 {
-	if (nla_len(nla) < len)
+	int nested_len = nla_len(nla) - NLA_ALIGN(len);
+
+	if (nested_len < 0)
 		return -1;
-	if (nla_len(nla) >= NLA_ALIGN(len) + sizeof(struct nlattr))
-		return nla_parse_nested(tb, maxtype,
-					nla_data(nla) + NLA_ALIGN(len),
-					policy);
+	if (nested_len >= nla_attr_size(0))
+		return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len),
+				 nested_len, policy);
 	memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
 	return 0;
 }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Fwd: [Bug 447812] New: Netlink messages from "tc" to sc..., Stephen Hemminger, (Wed May 21, 6:10 pm)
Re: Fwd: [Bug 447812] New: Netlink messages from "tc" to sc..., Thomas Graf, (Wed May 21, 8:21 pm)
Re: [NETLINK]: Fix nla_parse_nested_compat() to call nla_par..., Stephen Hemminger, (Thu May 22, 2:02 pm)