mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-26 23:54:47 +00:00
bpf: fix warnings on gcc-8 about string truncation
In theory, the path for BPF could exceed the 4K PATH_MAX. In practice, not really possible. But shut up gcc. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
0aaf62fcb6
commit
260a92afe6
@ -634,7 +634,7 @@ static int bpf_gen_global(const char *bpf_sub_dir)
|
||||
|
||||
static int bpf_gen_master(const char *base, const char *name)
|
||||
{
|
||||
char bpf_sub_dir[PATH_MAX];
|
||||
char bpf_sub_dir[PATH_MAX + NAME_MAX + 1];
|
||||
int ret;
|
||||
|
||||
snprintf(bpf_sub_dir, sizeof(bpf_sub_dir), "%s%s/", base, name);
|
||||
@ -675,8 +675,8 @@ static int bpf_slave_via_bind_mnt(const char *full_name,
|
||||
static int bpf_gen_slave(const char *base, const char *name,
|
||||
const char *link)
|
||||
{
|
||||
char bpf_lnk_dir[PATH_MAX];
|
||||
char bpf_sub_dir[PATH_MAX];
|
||||
char bpf_lnk_dir[PATH_MAX + NAME_MAX + 1];
|
||||
char bpf_sub_dir[PATH_MAX + NAME_MAX];
|
||||
struct stat sb = {};
|
||||
int ret;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user