]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
mnl: fix basehook comparison
authorDonald Yandt <donald.yandt@gmail.com>
Fri, 22 Nov 2024 22:04:49 +0000 (17:04 -0500)
committerPhil Sutter <phil@nwl.cc>
Fri, 29 Nov 2024 16:24:11 +0000 (17:24 +0100)
When comparing two hooks, if both device names are null,
the comparison should return true, as they are considered equal.

Fixes: b8872b83eb365 ("src: mnl: prepare for listing all device netdev device hooks")
Signed-off-by: Donald Yandt <donald.yandt@gmail.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
src/mnl.c

index 828006c4d6bfa3cd625eb629f229de0dd3d65c3e..88fac5bd0393a93628ebd7282bfe09b16022251e 100644 (file)
--- a/src/mnl.c
+++ b/src/mnl.c
@@ -2204,7 +2204,7 @@ static bool basehook_eq(const struct basehook *prev, const struct basehook *hook
        if (prev->devname != NULL && hook->devname != NULL)
                return strcmp(prev->devname, hook->devname) == 0;
 
-       if (prev->devname == NULL && prev->devname == NULL)
+       if (prev->devname == NULL && hook->devname == NULL)
                return true;
 
        return false;