]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
fix netlink message length checks
authorIgor Ryzhov <iryzhov@nfware.com>
Tue, 4 Oct 2016 10:16:55 +0000 (13:16 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 10 Oct 2016 01:48:30 +0000 (18:48 -0700)
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
ip/ipaddress.c
lib/ll_map.c

index fcc3c538d1bd88fbc66a46dbe885e607e06fb36c..3614837622e653836ed50615e5c13d98ddee6ab7 100644 (file)
@@ -1218,7 +1218,7 @@ static int print_selected_addrinfo(struct ifinfomsg *ifi,
                if (n->nlmsg_type != RTM_NEWADDR)
                        continue;
 
-               if (n->nlmsg_len < NLMSG_LENGTH(sizeof(ifa)))
+               if (n->nlmsg_len < NLMSG_LENGTH(sizeof(*ifa)))
                        return -1;
 
                if (ifa->ifa_index != ifi->ifi_index ||
index 571d11e1cd6b5ff9b2d993b5feb0997a8000b2c6..4e4556c9ac80ba64a0892a49b6cc19d1f4df4c2f 100644 (file)
@@ -90,7 +90,7 @@ int ll_remember_index(const struct sockaddr_nl *who,
        if (n->nlmsg_type != RTM_NEWLINK && n->nlmsg_type != RTM_DELLINK)
                return 0;
 
-       if (n->nlmsg_len < NLMSG_LENGTH(sizeof(ifi)))
+       if (n->nlmsg_len < NLMSG_LENGTH(sizeof(*ifi)))
                return -1;
 
        im = ll_get_by_index(ifi->ifi_index);