diff options
author | Andrii Nakryiko | 2019-07-24 23:47:53 +0200 |
---|---|---|
committer | Alexei Starovoitov | 2019-07-25 19:13:31 +0200 |
commit | cb8ffde5694ae5fffb456eae932aac442aa3a207 (patch) | |
tree | 0617a7e2179b05e4ddccc9182448a8d42c64f112 /kernel/bpf | |
parent | libbpf: fix using uninitialized ioctl results (diff) | |
download | kernel-qcow2-linux-cb8ffde5694ae5fffb456eae932aac442aa3a207.tar.gz kernel-qcow2-linux-cb8ffde5694ae5fffb456eae932aac442aa3a207.tar.xz kernel-qcow2-linux-cb8ffde5694ae5fffb456eae932aac442aa3a207.zip |
libbpf: silence GCC8 warning about string truncation
Despite a proper NULL-termination after strncpy(..., ..., IFNAMSIZ - 1),
GCC8 still complains about *expected* string truncation:
xsk.c:330:2: error: 'strncpy' output may be truncated copying 15 bytes
from a string of length 15 [-Werror=stringop-truncation]
strncpy(ifr.ifr_name, xsk->ifname, IFNAMSIZ - 1);
This patch gets rid of the issue altogether by using memcpy instead.
There is no performance regression, as strncpy will still copy and fill
all of the bytes anyway.
v1->v2:
- rebase against bpf tree.
Cc: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf')
0 files changed, 0 insertions, 0 deletions