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 /proto/babel/babel.h | |
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 'proto/babel/babel.h')
-rw-r--r-- | proto/babel/babel.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/proto/babel/babel.h b/proto/babel/babel.h index e075024c..09bf530c 100644 --- a/proto/babel/babel.h +++ b/proto/babel/babel.h @@ -198,7 +198,6 @@ struct babel_neighbor { struct babel_iface *ifa; ip_addr addr; - uint uc; /* Reference counter for seqno requests */ u16 rxcost; /* Sent in last IHU */ u16 txcost; /* Received in last IHU */ u16 cost; /* Computed neighbor cost */ @@ -212,6 +211,7 @@ struct babel_neighbor { btime ihu_expiry; list routes; /* Routes this neighbour has sent us (struct babel_route) */ + list requests; /* Seqno requests bound to this neighbor */ }; struct babel_source { @@ -241,6 +241,7 @@ struct babel_route { struct babel_seqno_request { node n; + node nbr_node; u64 router_id; u16 seqno; u8 hop_count; |