From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=anTqS5ZY; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 3FE8E5A061D for ; Mon, 11 May 2026 12:03:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1778493804; bh=1FwOdK4zWTjZ4XJ4vz0+/NJIMttqk49FG3w2nHwgD4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=anTqS5ZYTYz0fRyybxgVQlO5Rf88w+8sQDlJ5MjnMaODZJIuYb+zX0FKvhPVISXMK c1xJKZSb3MCKCSkz4UI9MsqQ3dTqbQ8gFlM1k10AuoB4PwG25auvdjPqahKFKEgfW1 lN9MTzSlRSQ3iNveJYwR6gRS9HhlTydPCHksSmSNCNcy7cccrHv3dQ9e0/39bh1uCX 9vXHEu9c1VTrST/eHedLOapV8l4l+xNceW3u+dvXmTkDAcz8TV+c9NorXbMwfzOMzu OeLUDgvBUUKxP1ksetTq8bhw2Qwo0l6QAhYSugNU1g1JPL/ihMcZedk7eAtqTHGZaf 1FjtqUvq4LExA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gDZzw1vhgz4wJw; Mon, 11 May 2026 20:03:24 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 7/8] treewide: Make some additional variables static Date: Mon, 11 May 2026 20:03:21 +1000 Message-ID: <20260511100322.1016757-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260511100322.1016757-1-david@gibson.dropbear.id.au> References: <20260511100322.1016757-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 4ONYH7ZCT5X23TUVAXW6G3JPROLQG5EU X-Message-ID-Hash: 4ONYH7ZCT5X23TUVAXW6G3JPROLQG5EU X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Mark a number of extra variables local to a single module as static. Signed-off-by: David Gibson --- conf.c | 2 +- log.c | 2 +- tcp.c | 6 +++--- tcp_buf.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conf.c b/conf.c index 8acf66cc..029b9c7c 100644 --- a/conf.c +++ b/conf.c @@ -67,7 +67,7 @@ {{{ 0xfe, 0x80, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0x01 }}} -const char *pasta_default_ifn = "tap0"; +static const char *pasta_default_ifn = "tap0"; /** * add_dns4() - Possibly add the IPv4 address of a DNS resolver to configuration diff --git a/log.c b/log.c index 21e3673e..cbac2efd 100644 --- a/log.c +++ b/log.c @@ -85,7 +85,7 @@ static int logtime_fmt(char *buf, size_t size, const struct timespec *ts) } /* Prefixes for log file messages, indexed by priority */ -const char *logfile_prefix[] = { +static const char *logfile_prefix[] = { NULL, NULL, NULL, /* Unused: LOG_EMERG, LOG_ALERT, LOG_CRIT */ "ERROR: ", "WARNING: ", diff --git a/tcp.c b/tcp.c index 92d9797a..d6a9ba28 100644 --- a/tcp.c +++ b/tcp.c @@ -370,8 +370,8 @@ enum { */ #define TCP_MIGRATE_SND_QUEUE_MAX (64 << 20) #define TCP_MIGRATE_RCV_QUEUE_MAX (64 << 20) -uint8_t tcp_migrate_snd_queue [TCP_MIGRATE_SND_QUEUE_MAX]; -uint8_t tcp_migrate_rcv_queue [TCP_MIGRATE_RCV_QUEUE_MAX]; +static uint8_t tcp_migrate_snd_queue [TCP_MIGRATE_SND_QUEUE_MAX]; +static uint8_t tcp_migrate_rcv_queue [TCP_MIGRATE_RCV_QUEUE_MAX]; #define TCP_MIGRATE_RESTORE_CHUNK_MIN 1024 /* Try smaller when above this */ @@ -420,7 +420,7 @@ char tcp_buf_discard [BUF_DISCARD_SIZE]; bool peek_offset_cap; /* Size of data returned by TCP_INFO getsockopt() */ -socklen_t tcp_info_size; +static socklen_t tcp_info_size; #define tcp_info_cap(f_) \ ((offsetof(struct tcp_info_linux, tcpi_##f_) + \ diff --git a/tcp_buf.c b/tcp_buf.c index 41965b10..a092cb37 100644 --- a/tcp_buf.c +++ b/tcp_buf.c @@ -45,8 +45,8 @@ static struct ethhdr tcp_eth_hdr[TCP_FRAMES_MEM]; static struct tap_hdr tcp_payload_tap_hdr[TCP_FRAMES_MEM]; /* IP headers for IPv4 and IPv6 */ -struct iphdr tcp4_payload_ip[TCP_FRAMES_MEM]; -struct ipv6hdr tcp6_payload_ip[TCP_FRAMES_MEM]; +static struct iphdr tcp4_payload_ip[TCP_FRAMES_MEM]; +static struct ipv6hdr tcp6_payload_ip[TCP_FRAMES_MEM]; /* TCP segments with payload for IPv4 and IPv6 frames */ static struct tcp_payload_t tcp_payload[TCP_FRAMES_MEM]; -- 2.54.0