From: Christian Brauner Date: Fri, 3 Sep 2021 09:25:56 +0000 (+0200) Subject: network: fix integer comparisons X-Git-Tag: lxc-4.0.11~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cda1acec9101cb6c745c72c01fdee8fd05a97867;p=thirdparty%2Flxc.git network: fix integer comparisons Signed-off-by: Christian Brauner --- 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);