Commit b9056d3d authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Implement flush_source.

parent e126bd1c
...@@ -81,6 +81,16 @@ find_source(const unsigned char *a, const unsigned char *p, unsigned char plen, ...@@ -81,6 +81,16 @@ find_source(const unsigned char *a, const unsigned char *p, unsigned char plen,
return src; return src;
} }
/* It is the caller's responsibility to check that no routes point at
this source. */
void
flush_source(struct source *src)
{
memset(src, 0, sizeof(*src));
VALGRIND_MAKE_MEM_UNDEFINED(src, sizeof(*src));
src->valid = 0;
}
struct source * struct source *
find_recent_source(const unsigned char *p, unsigned char plen) find_recent_source(const unsigned char *p, unsigned char plen)
{ {
......
...@@ -38,6 +38,7 @@ struct source *find_source(const unsigned char *a, ...@@ -38,6 +38,7 @@ struct source *find_source(const unsigned char *a,
const unsigned char *p, const unsigned char *p,
unsigned char plen, unsigned char plen,
int create, unsigned short seqno); int create, unsigned short seqno);
void flush_source(struct source *src);
struct source *find_recent_source(const unsigned char *p, struct source *find_recent_source(const unsigned char *p,
unsigned char plen); unsigned char plen);
void update_source(struct source *src, void update_source(struct source *src,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment