From patchwork Tue Sep 16 07:33:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Fastabend X-Patchwork-Id: 389997 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5B65314012E for ; Tue, 16 Sep 2014 17:34:02 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752741AbaIPHd6 (ORCPT ); Tue, 16 Sep 2014 03:33:58 -0400 Received: from mail-ob0-f175.google.com ([209.85.214.175]:41164 "EHLO mail-ob0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751964AbaIPHd5 (ORCPT ); Tue, 16 Sep 2014 03:33:57 -0400 Received: by mail-ob0-f175.google.com with SMTP id vb8so2402723obc.34 for ; Tue, 16 Sep 2014 00:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:cc:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=HnJ8JplPiEc7vdCIq2nj25r3yfAItGr+oJn6szacFhE=; b=lvS7zeawClcKzlgas83JPNAKcQQkPIjnYjI8x+kV8f59douljUOPLETZVqaixJAln4 7cx98fdLl9zVjWVPmoG2TEO4q0HmXdSFcM5yPFY4OPdtAXRt9cgrZxTUwfjiWyjN4p27 08YXJsI6+vnzwXbtZ742iA659kjsWmY86Dg9NQ98Ork/9+2RsEVZG1BLpO8Y3ec1ibig 50RHxIUh4jQZWKm8F6fK30KkPdyIVtFb0poZhHK/LCxe0j9dLOjSmS0F5ldZnO0F8v5K entMXox5AJkexpaT5E1FnclZ1ic/Cdi2s/CXA0Px1dQUMeWjpStJdvgRgW6glugTQj3t ttdQ== X-Received: by 10.182.133.104 with SMTP id pb8mr32638126obb.37.1410852836563; Tue, 16 Sep 2014 00:33:56 -0700 (PDT) Received: from nitbit.x32 ([72.168.134.86]) by mx.google.com with ESMTPSA id j16sm9261934obe.5.2014.09.16.00.33.49 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Sep 2014 00:33:55 -0700 (PDT) From: John Fastabend X-Google-Original-From: John Fastabend Subject: [net-next PATCH] net: sched: cls_cgroup need tcf_exts_init in all cases To: xiyou.wangcong@gmail.com, davem@davemloft.net, eric.dumazet@gmail.com Cc: netdev@vger.kernel.org, jhs@mojatatu.com Date: Tue, 16 Sep 2014 00:33:42 -0700 Message-ID: <20140916073341.2597.36240.stgit@nitbit.x32> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This ensures the tcf_exts_init() is called for all cases. Signed-off-by: John Fastabend Acked-by: Cong Wang --- net/sched/cls_cgroup.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 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 diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index 10c7ffd..15c34d4 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c @@ -116,12 +116,11 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb, if (!new) return -ENOBUFS; - if (head) { + tcf_exts_init(&new->exts, TCA_CGROUP_ACT, TCA_CGROUP_POLICE); + if (head) new->handle = head->handle; - } else { - tcf_exts_init(&new->exts, TCA_CGROUP_ACT, TCA_CGROUP_POLICE); + else new->handle = handle; - } new->tp = tp; err = nla_parse_nested(tb, TCA_CGROUP_MAX, tca[TCA_OPTIONS],