From ebd5751cdeb4c753c6c9df31b82dcd6afee2cd39 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Sun, 30 May 2021 13:07:16 +0200 Subject: 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. --- lib/lists.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/lists.h') 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) \ -- cgit v1.2.3