On 5/11/26 12:03, David Gibson wrote:
Mark a number of extra variables local to a single module as static.
Signed-off-by: David Gibson
Reviewed-by: Laurent Vivier
--- 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];