From: Donald Yandt Date: Fri, 22 Nov 2024 22:04:49 +0000 (-0500) Subject: mnl: fix basehook comparison X-Git-Tag: v1.1.2~117 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9819e717e8c31a80be2a12923e37fad99c378c91;p=thirdparty%2Fnftables.git mnl: fix basehook comparison 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 Signed-off-by: Phil Sutter --- diff --git a/src/mnl.c b/src/mnl.c index 828006c4..88fac5bd 100644 --- 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;