diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-06-25 09:25:49 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-06-25 09:25:49 +0000 |
commit | 2bdfda9df27abf98e578e3a0740bc7cc11d837c3 (patch) | |
tree | ab80b3f08ed280bfbe4b620a8fa8e7c0a7a2d353 | |
parent | 84314f5b73eb48420da9ec720a1182b3bb3817ba (diff) |
The network flush code only operates on peerself (like all the other
network commands). Instead of passing the peer as argument to the tree
walker just default to peerself in network_flush_upcall().
OK benno@
-rw-r--r-- | usr.sbin/bgpd/rde.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 4148f7e5623..f8d19de2f07 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.529 2021/06/25 09:23:26 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.530 2021/06/25 09:25:48 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -517,7 +517,7 @@ badnetdel: break; } if (rib_dump_new(RIB_ADJ_IN, AID_UNSPEC, - RDE_RUNNER_ROUNDS, peerself, network_flush_upcall, + RDE_RUNNER_ROUNDS, NULL, network_flush_upcall, NULL, NULL) == -1) log_warn("rde_dispatch: IMSG_NETWORK_FLUSH"); break; @@ -4065,13 +4065,12 @@ network_dump_upcall(struct rib_entry *re, void *ptr) static void network_flush_upcall(struct rib_entry *re, void *ptr) { - struct rde_peer *peer = ptr; struct bgpd_addr addr; struct prefix *p; u_int32_t i; u_int8_t prefixlen; - p = prefix_bypeer(re, peer); + p = prefix_bypeer(re, peerself); if (p == NULL) return; if ((prefix_aspath(p)->flags & F_ANN_DYNAMIC) != F_ANN_DYNAMIC) @@ -4084,14 +4083,14 @@ network_flush_upcall(struct rib_entry *re, void *ptr) struct rib *rib = rib_byid(i); if (rib == NULL) continue; - if (prefix_withdraw(rib, peer, &addr, prefixlen) == 1) - rde_update_log("flush announce", i, peer, + if (prefix_withdraw(rib, peerself, &addr, prefixlen) == 1) + rde_update_log("flush announce", i, peerself, NULL, &addr, prefixlen); } - if (prefix_withdraw(rib_byid(RIB_ADJ_IN), peer, &addr, + if (prefix_withdraw(rib_byid(RIB_ADJ_IN), peerself, &addr, prefixlen) == 1) - peer->prefix_cnt--; + peerself->prefix_cnt--; } /* clean up */ |