Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755360AbYHVBT6 (ORCPT ); Thu, 21 Aug 2008 21:19:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751146AbYHVBTq (ORCPT ); Thu, 21 Aug 2008 21:19:46 -0400 Received: from mail.vyatta.com ([216.93.170.194]:43387 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750926AbYHVBTp (ORCPT ); Thu, 21 Aug 2008 21:19:45 -0400 X-Spam-Flag: NO X-Spam-Score: -0.716 Date: Thu, 21 Aug 2008 21:19:41 -0400 From: Stephen Hemminger To: Jeff Kirsher Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, Alexander Duyck , Jeff Kirsher Subject: Re: [PATCH] IPROUTE: correct nla nested message generated by netem_parse_opt Message-ID: <20080821211941.66090862@speedy> In-Reply-To: <20080822005011.4615.98303.stgit@jtkirshe-mobile.jf.intel.com> References: <20080822005011.4615.98303.stgit@jtkirshe-mobile.jf.intel.com> Organization: Vyatta X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2217 Lines: 65 On Thu, 21 Aug 2008 17:50:11 -0700 Jeff Kirsher wrote: > From: Alexander Duyck > > netem_parse_opt was generating a malformed nested compat message. This patch > corrects it so that the nested arguments are contained within a nested nla > header. > > Signed-off-by: Alexander Duyck > Signed-off-by: Jeff Kirsher > --- > > tc/q_netem.c | 9 +++------ > 1 files changed, 3 insertions(+), 6 deletions(-) > > diff --git a/tc/q_netem.c b/tc/q_netem.c > index d06932e..a3365c1 100644 > --- a/tc/q_netem.c > +++ b/tc/q_netem.c > @@ -128,7 +128,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, > struct nlmsghdr *n) > { > size_t dist_size = 0; > - struct rtattr *tail; > + struct rtattr *nest; > struct tc_netem_qopt opt; > struct tc_netem_corr cor; > struct tc_netem_reorder reorder; > @@ -257,8 +257,6 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, > argc--; argv++; > } > > - tail = NLMSG_TAIL(n); > - > if (reorder.probability) { > if (opt.latency == 0) { > fprintf(stderr, "reordering not possible without specifying some delay\n"); > @@ -277,8 +275,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, > return -1; > } > > - if (addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)) < 0) > - return -1; > + nest = addattr_nest_compat(n, 1024, TCA_OPTIONS, &opt, sizeof(opt)); > > if (present[TCA_NETEM_CORR] && > addattr_l(n, 1024, TCA_NETEM_CORR, &cor, sizeof(cor)) < 0) > @@ -299,7 +296,7 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv, > return -1; > free(dist_data); > } > - tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail; > + addattr_nest_compat_end(n, nest); > return 0; > } > > The kernel ABI can not change? The nested attribute order should not change. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/