1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

hooks: node hooks can only be added to nodes, paths hooks only to paths

This commit is contained in:
Steffen Vogel 2017-09-04 14:33:13 +02:00
parent cd59d63db5
commit 24e371215a

View file

@ -40,6 +40,12 @@ int hook_init(struct hook *h, struct hook_type *vt, struct path *p, struct node
h->priority = vt->priority;
/* Node hooks can only used with nodes,
Path hooks only with paths.. */
if ((!(vt->flags & HOOK_NODE) && n) ||
(!(vt->flags & HOOK_PATH) && p))
return -1;
h->path = p;
h->node = n;