]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
nexthop: fix error reporting in filter dump
authorAndrea Claudi <aclaudi@redhat.com>
Tue, 10 Mar 2020 12:15:17 +0000 (13:15 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 15 Mar 2020 16:54:42 +0000 (09:54 -0700)
nh_dump_filter is missing a return value check in two cases.
Fix this simply adding an assignment to the proper variable.

Fixes: 63df8e8543b03 ("Add support for nexthop objects")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ipnexthop.c

index 9f860c8cea251693955ab149259f6b85a55367ea..99f89630ed189e60d9fa8a8c82d6e0eb25ade898 100644 (file)
@@ -59,13 +59,13 @@ static int nh_dump_filter(struct nlmsghdr *nlh, int reqlen)
        }
 
        if (filter.groups) {
-               addattr_l(nlh, reqlen, NHA_GROUPS, NULL, 0);
+               err = addattr_l(nlh, reqlen, NHA_GROUPS, NULL, 0);
                if (err)
                        return err;
        }
 
        if (filter.master) {
-               addattr32(nlh, reqlen, NHA_MASTER, filter.master);
+               err = addattr32(nlh, reqlen, NHA_MASTER, filter.master);
                if (err)
                        return err;
        }