From cda1acec9101cb6c745c72c01fdee8fd05a97867 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Fri, 3 Sep 2021 11:25:56 +0200 Subject: [PATCH] network: fix integer comparisons Signed-off-by: Christian Brauner --- src/lxc/network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/network.c b/src/lxc/network.c index 32963a0ea..6c6715d57 100644 --- a/src/lxc/network.c +++ b/src/lxc/network.c @@ -2518,7 +2518,7 @@ static int ifa_get_local_ip(int family, struct nlmsghdr *msg, void **res) * the address length is correct, but check here just in * case. */ - if (RTA_PAYLOAD(rta) != addrlen) + if (RTA_PAYLOAD(rta) != (unsigned int)addrlen) return -1; /* We might have found an IFA_ADDRESS before, which we @@ -2621,7 +2621,7 @@ static int ip_addr_get(int family, int ifindex, void **res) return ret_errno(EINVAL); ifa = (struct ifaddrmsg *)NLMSG_DATA(msg); - if (ifa->ifa_index == ifindex) { + if (ifa->ifa_index == (__u32)ifindex) { if (ifa_get_local_ip(family, msg, res) < 0) return ret_errno(EINVAL); -- 2.47.2