From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EF1CC43381 for ; Tue, 19 Feb 2019 18:21:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3DC702089F for ; Tue, 19 Feb 2019 18:21:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20150623.gappssmtp.com header.i=@networkplumber-org.20150623.gappssmtp.com header.b="htRyAG4n" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726368AbfBSSUC (ORCPT ); Tue, 19 Feb 2019 13:20:02 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:32872 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725807AbfBSSUC (ORCPT ); Tue, 19 Feb 2019 13:20:02 -0500 Received: by mail-pg1-f196.google.com with SMTP id h11so8148562pgl.0 for ; Tue, 19 Feb 2019 10:20:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EF53BnUmhJlMMxD3qxPwWpkvW+dgMzHllJGjymw85WI=; b=htRyAG4n6nJf/CXJqF6gmtMtaP0q6N4JOWA22fRYuzP8f0yhp68PveH1d2x29oiCS6 r9utN9/zIDngtp05hUoxvvLqzMd1WGFgZQ8bVsi39bp3kY+x6wcEgua2/JM1cpHBi7kJ Cg+oZNOVxEAbrMBs8jgHdUYMGqVuxeDeb3GSUS0/E2APVtMlSJICKpR8AhUsdg4TQIow iXO+mdYg1GwyN3GWMRJQ44bgRU62kRRLqd2iskt9Pn9DUHd56MCIbtN7noo+s+wGegQt iPQ9Fq8euEE4EkEmGYx6d+PUZx0VUTBHfHC7VhU5eykUIwq4A3Fbq05kIBfpaYkha7Hk r1bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EF53BnUmhJlMMxD3qxPwWpkvW+dgMzHllJGjymw85WI=; b=VFoibsI7I0vJjtKnjnNncFMLiqh9FnVCF5LnV32oo+kBpaHGTMf70vRNpwlxRCZNsj dhGGW5VGXfgSWH4l7Jl2VxovB+VqhU6fX6Ef4TajpwJIrVdgxxPfFdwT4YAUznsPYJAA ZGc28PZi8laVayx2Ewh5fTMZuhwSmeyc2V7AL+w1BuQZXAMfPPywH9MekWSbVekv4G3N coKtc28nuy4eNH/FGPblxsSn9VbIcW2oDgkzfZXcb/XC29vLpImRyKIF9Z2VQL9r/N97 9ONkcq2AKRXXi/aFnSo/n85SfSNlGpPqYx32qxRUz3AvLrhHKaMCSh/LM9sEGPkEjO93 yP/Q== X-Gm-Message-State: AHQUAuZQnMZc0pIDOwUGnnDiH1BgeQSXbt/Obltp8oy2Ubsb+me2j2hI sGzAoh85/VVUznYkpuI7EKFmucrdmPk= X-Google-Smtp-Source: AHgI3Ib/sTHvSgFX9MEV8Y7u7r9AEWKtCw7euodqZOEoQVKsmhG+z52KIXXw8feZ13Y8L3mTB1BuoQ== X-Received: by 2002:a63:1322:: with SMTP id i34mr1758711pgl.208.1550600401090; Tue, 19 Feb 2019 10:20:01 -0800 (PST) Received: from shemminger-XPS-13-9360 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id k7sm4776469pgr.28.2019.02.19.10.20.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Feb 2019 10:20:00 -0800 (PST) Date: Tue, 19 Feb 2019 10:19:58 -0800 From: Stephen Hemminger To: Thomas Haller Cc: netdev@vger.kernel.org Subject: Re: [PATCH iproute2] ip-rule/trivial: add comment about json key "to_tbl" for unspecific rule action Message-ID: <20190219101958.5c4bbd0d@shemminger-XPS-13-9360> In-Reply-To: <20190219140331.16630-1-thaller@redhat.com> References: <20190219140331.16630-1-thaller@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, 19 Feb 2019 15:03:31 +0100 Thomas Haller wrote: > The key should not be called "to_tbl" because it is exactly > not a FR_ACT_TO_TBL action. > > # ip rule add blackhole > # ip -j rule | python -m json.tool > ... > { > "priority": 0, > "src": "all", > "to_tbl": "blackhole" > }, > > Still, as this is already released API from v4.17.0, stick to it. > Only add a comment for this oddity. > > Related: 0dd4ccc56c0e ("iprule: add json support") > > Signed-off-by: Thomas Haller > --- > If it is still permissible to change the API, I can also send a patch to > rename "to_tbl" key to "action". > > ip/iprule.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/ip/iprule.c b/ip/iprule.c > index 2f58d8c2..aea175aa 100644 > --- a/ip/iprule.c > +++ b/ip/iprule.c > @@ -459,6 +459,8 @@ int print_rule(struct nlmsghdr *n, void *arg) > } else if (frh->action == FR_ACT_NOP) { > print_null(PRINT_ANY, "nop", "nop", NULL); > } else if (frh->action != FR_ACT_TO_TBL) { > + /* The action is not(!) to-tbl, however for historic > + * reasons, this JSON key is called "to_tbl". */ > print_string(PRINT_ANY, "to_tbl", "%s", > rtnl_rtntype_n2a(frh->action, b1, sizeof(b1))); > } Just fix it and add fixes tag. JSON has been only added for a short time.