diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-02-12 15:05:28 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-02-14 01:10:47 +0100 |
commit | 9f57983886e79b590d62f897ce50ac8f5cf15df9 (patch) | |
tree | dbfb6b735067dc84c0a6f7783b589eaa2a7778d6 | |
parent | 7ee4e172679029e54f44f096d2e0ec85905c79de (diff) | |
download | passt-9f57983886e79b590d62f897ce50ac8f5cf15df9.tar passt-9f57983886e79b590d62f897ce50ac8f5cf15df9.tar.gz passt-9f57983886e79b590d62f897ce50ac8f5cf15df9.tar.bz2 passt-9f57983886e79b590d62f897ce50ac8f5cf15df9.tar.lz passt-9f57983886e79b590d62f897ce50ac8f5cf15df9.tar.xz passt-9f57983886e79b590d62f897ce50ac8f5cf15df9.tar.zst passt-9f57983886e79b590d62f897ce50ac8f5cf15df9.zip |
netlink: Use const rtnh pointer
6c7623d07 ("netlink: Add support to fetch default gateway from multipath
routes") inadvertently introduced a new cppcheck warning for a variable
which could be a const pointer but isn't. This occurs with
cppcheck-2.13.0-1.fc39.x86_64 in Fedora 39 at least.
Fixes: 6c7623d07bbd ("netlink: Add support to fetch default gateway from multipath routes")
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | netlink.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -274,7 +274,7 @@ unsigned int nl_get_ext_if(int s, sa_family_t af) if (rta->rta_type == RTA_OIF) { ifi = *(unsigned int *)RTA_DATA(rta); } else if (rta->rta_type == RTA_MULTIPATH) { - struct rtnexthop *rtnh; + const struct rtnexthop *rtnh; rtnh = (struct rtnexthop *)RTA_DATA(rta); ifi = rtnh->rtnh_ifindex; |