]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
network: fix integer comparisons
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 3 Sep 2021 09:25:56 +0000 (11:25 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 3 Sep 2021 11:01:42 +0000 (13:01 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/network.c

index 32963a0ea3748f70b2f7638ddedd775279a37894..6c6715d574d7ab6b1519b8d0ce06f6d63522e24f 100644 (file)
@@ -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);