diff options
author | Maria Matejka <mq@ucw.cz> | 2021-05-30 13:07:16 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2021-05-30 13:29:21 +0200 |
commit | ebd5751cdeb4c753c6c9df31b82dcd6afee2cd39 (patch) | |
tree | f8bf9374c452fd2403989ae7fa972d1145b3f1ea /lib | |
parent | 10498b8e89a4509bdd447bd14f07a3b3e35ae575 (diff) |
Babel: Seqno requests are properly decoupled from neighbors when the underlying interface disappears
When an interface disappears, all the neighbors are freed as well. Seqno
requests were anyway not decoupled from them, leading to strange
segfaults. This fix adds a proper seqno request list inside neighbors to
make sure that no pointer to neighbor is kept after free.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lists.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/lists.h b/lib/lists.h index 066eafbb..479f4ed1 100644 --- a/lib/lists.h +++ b/lib/lists.h @@ -59,6 +59,8 @@ typedef union list { /* In fact two overlayed nodes */ /* WALK_LIST_FIRST supposes that called code removes each processed node */ #define WALK_LIST_FIRST(n,list) \ while(n=HEAD(list), (NODE (n))->next) +#define WALK_LIST_FIRST2(n,pos,list) \ + while(n=SKIP_BACK(typeof(*n),pos,HEAD(list)), (n)->pos.next) #define WALK_LIST_BACKWARDS(n,list) for(n=TAIL(list);(NODE (n))->prev; \ n=(void *)((NODE (n))->prev)) #define WALK_LIST_BACKWARDS_DELSAFE(n,prv,list) \ |