summaryrefslogtreecommitdiffstats
path: root/nhrpd/nhrpd.h
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-10-16 14:51:43 +0200
committerMark Stapp <mjs@voltanet.io>2019-10-16 17:01:41 +0200
commitbd2b75a21e20bcf377d6bc2e30517d5c9072c287 (patch)
tree0dbbab7370330134dc420a8294714dab19b4080c /nhrpd/nhrpd.h
parentMerge pull request #5156 from donaldsharp/soft_reconfig_the_peer (diff)
downloadfrr-bd2b75a21e20bcf377d6bc2e30517d5c9072c287.tar.xz
frr-bd2b75a21e20bcf377d6bc2e30517d5c9072c287.zip
nhrpd: be more careful with linked lists
NHRPD has its own linked-list implementation, and one of the apis is a little free and easy with pointers. Also be safer with one list iteration operation. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'nhrpd/nhrpd.h')
-rw-r--r--nhrpd/nhrpd.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/nhrpd/nhrpd.h b/nhrpd/nhrpd.h
index 50746d9ad..ad38cad83 100644
--- a/nhrpd/nhrpd.h
+++ b/nhrpd/nhrpd.h
@@ -76,8 +76,10 @@ static inline void notifier_del(struct notifier_block *n)
static inline void notifier_call(struct notifier_list *l, int cmd)
{
struct notifier_block *n, *nn;
- list_for_each_entry_safe(n, nn, &l->notifier_head, notifier_entry)
- n->action(n, cmd);
+ list_for_each_entry_safe(n, nn, &l->notifier_head, notifier_entry) {
+ if (n)
+ n->action(n, cmd);
+ }
}
static inline int notifier_active(struct notifier_list *l)