diff options
author | Pradosh Mohapatra <pmohapat@cumulusnetworks.com> | 2014-04-28 10:58:06 +0000 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2014-05-14 16:46:41 +0200 |
commit | b4b359a265f1b6272b4eb17c11e9c6ef9817f34b (patch) | |
tree | f6721202e8ee9f44ccdc54a61e4b74c6552912c0 /lib | |
parent | 8afee5c1729e56f74d27ceb1766bea9f943f060c (diff) | |
download | quagga-b4b359a265f1b6272b4eb17c11e9c6ef9817f34b.tar.bz2 quagga-b4b359a265f1b6272b4eb17c11e9c6ef9817f34b.tar.xz |
ospfd: For an ABR, ensure the right LSID is MaxAge'd
PROBLEM:
Accurate garbage collection of maxage LSAs. The global OSPF structure has
a maxage_lsa tree - the key to the tree is <ls-id, adv-router> tuple. Suppose
the ABR has multiple areas and has originated some intra-area LSAs. The
key for all those LSAs is the same. The code then ends up in a state where
all but the first LSA do not get cleaned up from the areas' LSDB. A subsequent
event would readvertise those LSAs.
PATCH:
Since the LSA is going to stick around till it actually gets cleaned up by
the maxage_walker, make the LSA pointer as the key. Each distinct LSA that
gets maxage'd then gets added to the tree and will get cleaned up correctly.
Signed-off-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com>
[CF: Use CHAR_BIT; use uintptr_t; use sizeof(field) instead of sizeof(type)]
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
[DL: this must remain a temporary fix! needs to be redone after 0.99.23]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/prefix.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/prefix.h b/lib/prefix.h index 9ef70ff5..45889e08 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -52,6 +52,7 @@ struct prefix struct in_addr adv_router; } lp; u_char val[8]; + uintptr_t ptr; } u __attribute__ ((aligned (8))); }; @@ -89,6 +90,14 @@ struct prefix_rd u_char val[8] __attribute__ ((aligned (8))); }; +/* Prefix for a generic pointer */ +struct prefix_ptr +{ + u_char family; + u_char prefixlen; + uintptr_t prefix __attribute__ ((aligned (8))); +}; + /* helper to get type safety/avoid casts on calls * (w/o this, functions accepting all prefix types need casts on the caller * side, which strips type safety since the cast will accept any pointer |