🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24749

[PATCH iproute2-next 01/10] xfrm: rename shadowed SA direction local

#24749
From: Stephen Hemminger
Date: Mon, 30 Nov 2026 18:47
42 lines
11901 bytes
xfrm_xfrma_print() takes a bool parameter named "dir" that selects
whether the direction is printed.  The XFRMA_SA_DIR block declares a
__u8 local of the same name holding the attribute value, so the two
distinct meanings share one identifier and the local hides the
parameter for the rest of the block.

Rename the local to sa_dir.  No change in output; the fallback that
prints an unrecognized direction keeps reporting the attribute value
rather than the print flag.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 ip/ipxfrm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 78d9e192..4a63dc16 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -908,15 +908,15 @@ void xfrm_xfrma_print(struct rtattr *tb[], __u16 family, FILE *fp,
 		fprintf(fp, "%s", _SL_);
 	}
 	if (tb[XFRMA_SA_DIR]) {
-		__u8 dir = rta_getattr_u8(tb[XFRMA_SA_DIR]);
+		__u8 sa_dir = rta_getattr_u8(tb[XFRMA_SA_DIR]);
 
 		fprintf(fp, "\tdir ");
-		if (dir == XFRM_SA_DIR_IN)
+		if (sa_dir == XFRM_SA_DIR_IN)
 			fprintf(fp, "in");
-		else if (dir == XFRM_SA_DIR_OUT)
+		else if (sa_dir == XFRM_SA_DIR_OUT)
 			fprintf(fp, "out");
 		else
-			fprintf(fp, "other (%d)", dir);
+			fprintf(fp, "other (%d)", sa_dir);
 		fprintf(fp, "%s", _SL_);
 	}
 	if (tb[XFRMA_SA_PCPU]) {
-- 
2.53.0
Technical Details
Message-ID: <20261130184752.545119-2-stephen@networkplumber.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374399-linux-kernel-netdev=dewy.ru
References: <20261130184752.545119-1-stephen@networkplumber.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374399-linux-kernel-netdev=dewy.ru
From: stephen@networkplumber.org (Stephen Hemminger)
Newsgroups: linux.kernel.netdev
Subject: [PATCH iproute2-next 01/10] xfrm: rename shadowed SA direction local
Date: Mon, 30 Nov 2026 10:47:02 -0800
Organization: Usenet Network
Message-ID: <20261130184752.545119-2-stephen@networkplumber.org>
References: <20261130184752.545119-1-stephen@networkplumber.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1512319"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:yZ7Xc6bE2vlZbHVwQW7FZ0eDSpw= sha256:kOQVfr21Y97KTEI1k1boi2r4dnQqgrwlKqZ2Pvs3P30= sha1:pNao/0K4bR6OT7SB7gqYaD21/dU= sha256:CVnCSqU/1Aisul650Bbk8tLEATDyjGO82UoJOkc93Gg=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 40047126009; Mon, 30 Nov 2026 22:11:32 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.951
X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o28NUldECrZl; Mon, 30 Nov 2026 22:11:29 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374399-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=quarantine dis=none) header.from=networkplumber.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 04C9C125FFC; Mon, 30 Nov 2026 22:11:20 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 0AA3F2A387; Mon, 30 Nov 2026 19:11:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796065876; b=GGFg7+tpI211JGKKjG8JsmCF143at/CVvFauGKEYuj7gSvDhTg9WKuK3CCrCgxqZDZUe d9oc6JrjJC/ViEiSgTiu7LWJ2MJtxYgKIqB2DNixqaFI0u+U5cIfOThDfm59kHMsbyRNx ooTGP429FCsUeDk4J4XDsu+WMulzzEVc1YNIlsbv1ciN7jLNxvY9JCmWuZh/G4lEcHIhw rNZ2bK44sa3f5IaJccNCrIKIUII847cyPYlmxuBXUDbhNdgla/uuhPpylbghwwJBYP7Jw 1RPVVDC1sX2ieLBh6HDL/8FM0iYXntHb6DHOWQE8r6mj9/U6Mi/WXZmhgzieVhtLVCw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796065876; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=1IILzCTkADDfiUlK+hVtojxgI5C2VrWPmCcGOW7x0XM=; b=mAH0k9kr9z0Ivd9NmnuiNUcnFj6qOMcn0TBc7aE/hjOuhrYYIzQeBSXfadsRR8A/D/6e hGevvlrSDTe50v3OAUCOXOHJ7Xhbf+BhU2s5GvHuKqvyCkjyADMvUONJ9+OhwOC/0QxIP B4Ns3PHyCRvdFqWVaRAthvyW3s4eFlsqRiu9tHx309ZnDqE77oK42qTTNTj1O71JNPtob bENmBMlYb8dojvr0Gmi6nxfV8ngPNZmVjzh7FNuhZ6m/OAvTRl3Oj6sIvoGeQH5sM+zJg WT7iv0JGwUmCnJecR1HTo6ndQmih7yPLp7eW1+9d3WL2sd27g6rc1NOz7Vnj7B4XjFA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=Dk1HIBPb; dmarc=pass header.from=networkplumber.org; spf=pass smtp.mailfrom=networkplumber.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53C84606A337; Mon, 30 Nov 2026 19:11:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=Dk1HIBPb
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.179
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796065875; b=dQE2l/OiWQvNQiNW0UGvWAAqQwNED1A3NRZ1W15ZusQcGhdfXoW0mr/2yLP04Axnw7oQ dUPIbvCNAarUlqrAIbOCFi1YRp5NYe1snB57cLb8Crz6IuMpwtOIhgNtoFUUG+Zxbdvw9 ipcpg0enVhQy30j4YoMs1WlZi2mu6nmV/3cYXEXsyLTwDpfCi84UVmm8eZAmYHpzSiOer uE5wEn0+UjJl2O11x6NvHM1AeeL+exqgHHxK76jBM0EQDftQoheQNntr1B83nCv35ZjVj p/aoKMHzH+C9fJDfp06Tiwo2oNr96ta+R4KJ+ogygfvU9QAFHSi3YgDJnvrbu6ZJyzg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796065875; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=1IILzCTkADDfiUlK+hVtojxgI5C2VrWPmCcGOW7x0XM=; b=5StZ5xQ17fY7wWMH380TtWTvsRiMYujkjhlTzDjfEjQ1qF8yMHvpbQowUSBBNBOHqnIu 2w+JS4IUiQ1S6uajXHMgkaKQlBHLYKHpY+7at+v9QeUltJQy6keFQ6rtXxOCm2c+4Oslf 7NP5VeJ/fg1sXPPjkgZ6gdub8wvAZ4fUHfcjtSs6oyPObu/Jp46XGAle318sFc2f23jNl PJhzM7IHP+jUJAbsvB3NgVqwWV1apC27K+stI1+MyPlCepu9urwU9Ps+n+DRbQnzT3sC/ jxf6QXCSxhlsoo+duswYT3jwNHgrCCJG7p/frO5J8tLOEO5+3wMbueaV5xTv5LFb4nw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=networkplumber.org; spf=pass smtp.mailfrom=networkplumber.org; dkim=pass header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=Dk1HIBPb; arc=none smtp.remote-ip=209.85.215.179
X-Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D809606A325 for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 19:11:15 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2D809606A325
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=networkplumber.org
X-Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-ccca948203aso7339156a12.3 for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 11:11:15 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796065874; x=1796670674; 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:content-type; bh=1IILzCTkADDfiUlK+hVtojxgI5C2VrWPmCcGOW7x0XM=; b=Dk1HIBPbDXaosK6uxyyn3Kj1CV88qiyxhxySEADoxPb7ycLaukCiq+/H3R4Z+kqWNW 7LWXM0t8yhZH0QSS3rfy8Uv/7Oi0DeZ+lG1kF2QH1q6y/3SWY2cxl5MSGm/YMN3C3Q4z /klxWYzNXBQKZp0QiF1thMOlPHSJ+apCYuYodrMx76vSTSbekUbYbync8KM0wx/UGDrw qcbMJOKWvqNa8GWUu+34oSdLEMYpeUrZzCFMM6AiIN7u4O9bidncKNarbHNCwkL6moAq uiaEqHGxea4oMbpAIofmLeQerPzWoLQoOCRExPxtCPJjf06Rqs98cdqdk56yPdBn9jQE hZOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796065874; x=1796670674; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=1IILzCTkADDfiUlK+hVtojxgI5C2VrWPmCcGOW7x0XM=; b=RZwfvvRg18C3crXKd2xBRWW4BVpKzfx+H+sBW7RS4kvjpmQeQRq4qArUdh2YZNN4BH LkgHN+LZ54zo14oPZ9xcPGDrqTGPkqlrav9aDBBbyWDzsg69jssiLHP5IDy98J+zpdyq nlkrJ8hXHy1dYOvaz2rXFNg/9vbccfLedK4oFCgvEZdMVbn7fBvzJCD2FUpUQ0z/Q5sn ddygCaoQ5KkutTtKTNqeE/DKP2EWyfMzxwiPveO+0K0rB1m1t6L4l8+tujKfCa2dbMt0 UO2WBCSYdNQBzaUOx920o7AVZKJJ+GGBb1Ku5L5eHb6OFMUHg4+GtLmbXAGJrtIPKlPv MmLQ==
X-Gm-Message-State: APuU4Z9QfyR2QmrqFHN1UMGjmXv/WWAekY+UcnB6qv9n1nm1QAH1hmlH SII+GCUR9AV4YfM+Oo+x8FNdmsHbB5eYGN0QmT2iusU/p0wncY4+mcFSp5xZW6Anw26jCim3E4E kk77zDGY=
X-Gm-Gg: AZFdTZfuh9qU7WJWaHW0flfDtyPkyg6Aw2xRHdjUvhYy9xi+p1cYQatBqkJL+vNMV07 nNdj1/mdKWw8mWa3jG8EAXqNGWy0XleEJe3A4Th6oIAAndiu8qmLvOde3KnA/xzhce1SVzb7KMk sRbJFs9pOFgf3QQLe1UJn24jYOXzj1APvv9dIiFuHuaO1B7iAgueLLDz2BmwM/zizYUTpMtK6QD I5uKV7iff3k/nlI6hp49XumAjnaStERNkfQlwkzPrsa7qo6OhgKJVs7X5viGmKQXL1HumG8Unb7 kbsyXzRct3m/9LxLkE8kqNb3Vhz9L4KQAD8k9Yyy2jS3tSEmDL6yyXWmqFFZEBWNNJ7ULN1ayTo cBliPXJrE/a5gD1xUaCjas/xHXl0nOEYV3aePiS/Ad7xbnCpTfCHlSuU0Lue0twh4jdLPvDO8c0 z8l8YpuYRrJTWqhFcCC0rGAnGnXr2Qvbmptc0n2Zu/sJiMI/4w2IE3KuQ/mSP5+4lLtJ7KXJJn6 BzcxyxdBy/Nyfrh1WRfPKH4PjB32SKfXo1KOB1SACGZXlVWLlL5hzAU2ivlebVAsI1zpG+cRcMM a0huwhptWLP8gctxPUkzrekKZSuVGLt/5CpZf6ViYo2aGHLQs3kA8E5CGEV8kt1PvF/o
X-Received: by 2002:a17:90b:3f0f:b0:3b4:393:452a with SMTP id 98e67ed59e1d1-3b41c9120c3mr37190012a91.23.1796065874550; Mon, 30 Nov 2026 11:11:14 -0800 (PST)
X-Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b40f4312dfsm55591195a91.3.2026.11.30.11.11.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 11:11:14 -0800 (PST)
X-Cc: dsahern@kernel.org, Stephen Hemminger <stephen@networkplumber.org>
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <20261130184752.545119-1-stephen@networkplumber.org>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list