summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-02-13 13:27:18 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2020-02-13 13:31:31 +0100
commitf391fdd8e0fbaf3749819cfa0cd9b478f3630a7d (patch)
tree65931a5005c4661b69e0e5e67db912b84c69fab1 /include
parent76c358ccfea07fe8447359db00488e1bd13e1b73 (diff)
scanner: use list_is_first() from scanner_pop_indesc()
!list_empty() always stands true since the list is never empty when calling scanner_pop_indesc(). Check for list_is_first() which actually tells us this is the initial input file, hence, state->indesc is set to NULL. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r--include/list.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/list.h b/include/list.h
index 75d29212..9c4da817 100644
--- a/include/list.h
+++ b/include/list.h
@@ -33,6 +33,17 @@ static inline void init_list_head(struct list_head *list)
list->prev = list;
}
+/**
+ * list_is_first -- tests whether @list is the first entry in list @head
+ * @list: the entry to test
+ * @head: the head of the list
+ */
+static inline int list_is_first(const struct list_head *list,
+ const struct list_head *head)
+{
+ return list->prev == head;
+}
+
/*
* Insert a new entry between two known consecutive entries.
*