From patchwork Fri Feb 9 23:55:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 13551994 X-Patchwork-Delegate: dsahern@gmail.com Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9399638F91 for ; Fri, 9 Feb 2024 23:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707522984; cv=none; b=ckb8E0oL+JVJsitDHUKKYSjIKFfftAGJuguLqSNMOyhOiHzE1oKGD6OhIvy0R11UC7q165xDK4aOtlUQzNovSbsAnPRoISV9eZ9BOo64YQtLpJitn71lXlXhYZSUxcvVQPq1UexNjQnMebZh426MHgRLy7XPRCvZHP7oX8oTF34= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707522984; c=relaxed/simple; bh=m0KmTMod/IfitqNv82GKiI7Nwj3IgwgUsghwVe63ilU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=raiq8NDIBfW66yQj87s57ifzkyndtV9NNeVSw48vEO3HSIyFk86EkA6hpje7vZvfyc0il7PSMQ6KGd2qMcSIDbW/HgquPUi4+uU6pUoPRVUZnua9swoZXsdwzwNeoDKNRvdgp6oqTWi60/9grR9Z78xu+oanLqcWPRObTsTl/Xg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org; spf=pass smtp.mailfrom=networkplumber.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20230601.gappssmtp.com header.i=@networkplumber-org.20230601.gappssmtp.com header.b=y3frgEwf; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20230601.gappssmtp.com header.i=@networkplumber-org.20230601.gappssmtp.com header.b="y3frgEwf" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1d93ddd76adso11982155ad.2 for ; Fri, 09 Feb 2024 15:56:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1707522982; x=1708127782; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=r4SqyzWBJTEFulWwag6urEQadom2GFrdZ/DrmTbyVoI=; b=y3frgEwfB2ajlCEDaO5bmzYj+gyvwptusrDeVtMCpOPA940WlscvJC3GwcW/rgmvvZ ydxjdhKKQMx8wzewjRWhiNZUx4jYQ1jlUH1dOtLFjzKrhq0aSjuMfHToCduAipvCJxqz H1KXQc7G4yW/7ojCVG2/awUHrGOdQmDjMba4B/k7wJnNN+vNZ0w23jA24kJAQK6t1qQP 0tMJ3co4XRK1P4/21rW9rnPuR4hRdLRXWbXapzczmnRzrXd3yBlLz8OhkL7s2lsAm8JB 5KZicqLEvKXI8JQ51ERkbd+STKmLt28Bgw0J1LO26tFZpO5JDsoN8AYFdBcA4PAJlLce t6nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707522982; x=1708127782; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=r4SqyzWBJTEFulWwag6urEQadom2GFrdZ/DrmTbyVoI=; b=Nz0z1CZtuVHqbMOVEMV5MdLdgB6TAqevjCzofO/Y5XiGmg3O+SEwK3vsInJtiNtOEr 49hKESv9HGl+HLNDU+VU46jheCzEm7kQIa2B+e7C9FIY8Ep04Uma01T6EJox8XAhqJ94 QY6Hnl7w/hC8prPdeQ4RXy2mm7dccBYe0Mx6mLxTcjr8IjXLb0gxF0OOyGTwLsCuR53M jcLx8pWSx989xS3NBD3rbTwTxWs393JQyKLxS0G6aHLhxsJ2Etirlt8NdAlQKeA6aht7 Eu/PNBX9SW59XKqOYmuZvV/k92YY3jcQmntPVCLTiK4WEnirYqgFwQpjUQ6VStc6kGak r0wQ== X-Gm-Message-State: AOJu0YznHBeEWvAmgYrVHuTFkNFTjAiNJ0T45od7rpEGk9sfgJK4c1hD +xRN32WflcW4yiSOaa+hXGK8SkymBdO/eM2lXEGvF52i19937xsxllPvKppTetLV/0JkG76Xm9K 2 X-Google-Smtp-Source: AGHT+IFC65Ln/doLcnJMCUejPg/rsqXH/Z2fJIdeGVSmRnIM+9WDhDbYlCdXMXx+QTexgmkE4m26eQ== X-Received: by 2002:a17:903:1ca:b0:1d6:fcc3:c98f with SMTP id e10-20020a17090301ca00b001d6fcc3c98fmr689645plh.29.1707522981853; Fri, 09 Feb 2024 15:56:21 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id c18-20020a170903235200b001d9a1d7a525sm2018420plh.273.2024.02.09.15.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 15:56:21 -0800 (PST) From: Stephen Hemminger To: netdev@vger.kernel.org Cc: Stephen Hemminger Subject: [PATCH iproute2 1/2] tc: bpf: fix extra newline in JSON output Date: Fri, 9 Feb 2024 15:55:56 -0800 Message-ID: <20240209235612.404888-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: dsahern@gmail.com Don't print newline at end of bpf if in JSON mode. Signed-off-by: Stephen Hemminger --- tc/m_bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/m_bpf.c b/tc/m_bpf.c index 4eadcb6daac4..da50c05e1529 100644 --- a/tc/m_bpf.c +++ b/tc/m_bpf.c @@ -204,7 +204,7 @@ static int bpf_print_opt(struct action_util *au, FILE *f, struct rtattr *arg) } } - fprintf(f, "\n "); + print_string(PRINT_FP, NULL, "%s", "\n "); return 0; } From patchwork Fri Feb 9 23:55:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 13551995 X-Patchwork-Delegate: dsahern@gmail.com Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2407711CAF for ; Fri, 9 Feb 2024 23:56:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707522985; cv=none; b=mKQZilH6Jh5B6gUcI6ohtycWtnaNH+lEmBUVyZxQoR0WC9DaX5XBGnWC2BVoiQUv6C2Y6wWxDtwr/ccYYuNOGlvsiSnvJb1Her7lawVU1Bu9dWbznMvn5xIUj6L8bHytY3XBbwN1jPQZbMDpfF26uyPTue+9cnHyuhFL5cAMpF4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707522985; c=relaxed/simple; bh=TfX4V+/UlUdvWzbJrrKPVwlSzutnyiFGEOg7ASjnSMk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IXMevO24+/y0yDlI/NUTiI5LOnRp4fGr8DZwbLEJNCRkaqmLcTOUofzpfaGG8yM4WBVhstwbKJ1OE47bYKq9bcKZee42+Cng/Sk6moO6r2wNxGSVTfZORQxJrT83suGvAlH+bnWIPLmiIM3rLRMr7KV1VDHpr0thsietXbHe7vg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org; spf=pass smtp.mailfrom=networkplumber.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20230601.gappssmtp.com header.i=@networkplumber-org.20230601.gappssmtp.com header.b=EtYT+320; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20230601.gappssmtp.com header.i=@networkplumber-org.20230601.gappssmtp.com header.b="EtYT+320" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1d71cb97937so15096145ad.3 for ; Fri, 09 Feb 2024 15:56:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1707522982; x=1708127782; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9kecyRCBPP8cHunv6tkqoi9TAbGIbv60BfFWzKZvwYs=; b=EtYT+320SjJJpfoQ/iFIIWC6M+XjGTWbRwq7WcTuH91fH5qjeRjqMUaaYCGHbTC+3k jc/OMQAB1E5RcWabrpNA1u32p50E60h/k9sZDekbD508UKlTmf8UqGqtuEVPjbQyYYpG bWUA0KkKjwY4+fC7D357MYX8zwF2ROKmSLAB3VU1ho1Ob519fS5T1rZqkGTnP+3RA5ej WZMopzKXeVimyeCSvbGuN4fF0ZsdhV1RQuc5e6PaVv3LLt1J+LFHSPFEl7UoNYIkdT2h 1Zp07byiwian2fx41BC2lsS5MsPtCmXbLYTmvkvJefrMS/aybRjF0/OPqp0ePqG4ZcMd uZBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707522982; x=1708127782; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9kecyRCBPP8cHunv6tkqoi9TAbGIbv60BfFWzKZvwYs=; b=WIgRb/lPXQGt2EdPGAg/DXTEn5qN38+wyuDySBE+o1S2gNsNqZaJjfnJe5OFeO0tzo 5On2wnynhRCfw1GAyVNMN1w3LjazPN5+w6SyUIft320yhN8cBUo7OTmioW7B1Wa9C8bZ Sz+cDy91IAExF9nfRRcAqZJy1V82DMRI5OA33X11R9bRUoSBh1cFUuje9/TK2quzdCA8 X9M4/UoIy3QlEBGW+l66Xmw5BhDL6T78xPdLidn7KHu2C11XOSzzGSzJ1DHAVtlXFSZl X5+z+y11L3vcwCV3PgPWOIOc75qOSHj2Y+n41B6UzeEL2lBBM+UXMdtFlxNTshUYx9Jp VGhQ== X-Gm-Message-State: AOJu0YzsEETHLzEpOR6qoUEtr/knYCSlVYyeZP0+kNe08Y2puVp/LCjh J/ObskkQhvxLuWsogGtwG2ePpZffmTU/KVI89rnZZK2m7QWV9Kij/e/Q3DyfEpaaARQQ6St7VM3 B X-Google-Smtp-Source: AGHT+IEZXRBSITbmZu5eDIUCucQeyTvi1AI4Xym2Mk5SNkXPVbcQCl7R48801VAihACHHWvuoZHXLw== X-Received: by 2002:a17:902:6545:b0:1da:1b60:2209 with SMTP id d5-20020a170902654500b001da1b602209mr769112pln.44.1707522982440; Fri, 09 Feb 2024 15:56:22 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id c18-20020a170903235200b001d9a1d7a525sm2018420plh.273.2024.02.09.15.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 15:56:22 -0800 (PST) From: Stephen Hemminger To: netdev@vger.kernel.org Cc: Stephen Hemminger Subject: [PATCH iproute2 2/2] tc: print unknown action on stderr Date: Fri, 9 Feb 2024 15:55:57 -0800 Message-ID: <20240209235612.404888-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209235612.404888-1-stephen@networkplumber.org> References: <20240209235612.404888-1-stephen@networkplumber.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: dsahern@gmail.com This is an error, and should not go to stdout. Signed-off-by: Stephen Hemminger --- tc/m_action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/m_action.c b/tc/m_action.c index 16474c56118c..f180ba09778c 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -62,7 +62,7 @@ static void act_usage(void) static int print_noaopt(struct action_util *au, FILE *f, struct rtattr *opt) { if (opt && RTA_PAYLOAD(opt)) - fprintf(f, "[Unknown action, optlen=%u] ", + fprintf(stderr, "[Unknown action, optlen=%u] ", (unsigned int) RTA_PAYLOAD(opt)); return 0; }