]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Only callback when there is a callback.
authorRoy Marples <roy@marples.name>
Mon, 5 Sep 2016 19:43:14 +0000 (19:43 +0000)
committerRoy Marples <roy@marples.name>
Mon, 5 Sep 2016 19:43:14 +0000 (19:43 +0000)
if-linux.c

index 88a389814361a5cfa89caa210ce0cbc3b0c7bbc9..11a8c5fb06496c63c67d8b123de522689bc56066 100644 (file)
@@ -363,7 +363,7 @@ get_netlink(struct dhcpcd_ctx *ctx, struct interface *ifp, int fd, int flags,
                }
                if (nlm->nlmsg_type == NLMSG_DONE)
                        break;
-               if ((r = callback(ctx, ifp, nlm)) != 0)
+               if (callback && (r = callback(ctx, ifp, nlm)) != 0)
                        break;
        }