-/* $OpenBSD: rde.c,v 1.409 2018/08/06 08:10:12 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.410 2018/08/06 08:13:31 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
/* walk through per peer RIB list and remove all stale prefixes. */
for (asp = TAILQ_FIRST(&peer->path_h); asp != NULL; asp = nasp) {
nasp = TAILQ_NEXT(asp, peer_l);
- rprefixes += path_remove_stale(asp, aid);
+ rprefixes += path_remove_stale(asp, aid, peer->staletime[aid]);
}
/* Deletions are performed in path_remove() */
-/* $OpenBSD: rde.h,v 1.183 2018/08/03 16:31:22 claudio Exp $ */
+/* $OpenBSD: rde.h,v 1.184 2018/08/06 08:13:31 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and
struct filterstate *, struct bgpd_addr *, int, int);
int path_compare(struct rde_aspath *, struct rde_aspath *);
void path_remove(struct rde_aspath *);
-u_int32_t path_remove_stale(struct rde_aspath *, u_int8_t);
+u_int32_t path_remove_stale(struct rde_aspath *, u_int8_t, time_t);
void path_destroy(struct rde_aspath *);
int path_empty(struct rde_aspath *);
struct rde_aspath *path_copy(struct rde_aspath *, const struct rde_aspath *);
-/* $OpenBSD: rde_rib.c,v 1.173 2018/08/03 16:31:22 claudio Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.174 2018/08/06 08:13:31 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
/* remove all stale routes or if staletime is 0 remove all routes for
a specified AID. */
u_int32_t
-path_remove_stale(struct rde_aspath *asp, u_int8_t aid)
+path_remove_stale(struct rde_aspath *asp, u_int8_t aid, time_t staletime)
{
struct prefix *p, *np;
- time_t staletime;
u_int32_t rprefixes;
int has_updates;
rprefixes=0;
- staletime = asp->peer->staletime[aid];
/*
* Same magic as in path_remove() but probably not needed here.
* This is called when a session flapped and during that time