summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2021-03-29 04:43:04 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-04-16 20:06:00 +0200
commit4d56b70dc5facdf4b839b76bf80c93856bcbb121 (patch)
tree8cb9a6f7cc5b3ea463e018a82186f95f0860f6f0 /nest
parent568fd666136fcf7a37eb445d18b478b6464536c4 (diff)
BMP: Remove duplicate functions for update encoding
Use existing BGP functions also for BMP update encoding.
Diffstat (limited to 'nest')
-rw-r--r--nest/protocol.h3
-rw-r--r--nest/rt-table.c10
2 files changed, 6 insertions, 7 deletions
diff --git a/nest/protocol.h b/nest/protocol.h
index 03b8a8ec..da6d434e 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -214,8 +214,7 @@ struct proto {
void (*if_notify)(struct proto *, unsigned flags, struct iface *i);
void (*ifa_notify)(struct proto *, unsigned flags, struct ifa *a);
void (*rt_notify)(struct proto *, struct channel *, struct network *net, struct rte *new, struct rte *old);
- void (*rte_update_in_notify)(const struct proto *, const struct channel *,
- const net *net, const struct rte *new, const struct rte *old, const struct rte_src *src);
+ void (*rte_update_in_notify)(struct channel *, const net_addr *, const struct rte *, const struct rte_src *);
void (*neigh_notify)(struct neighbor *neigh);
int (*preexport)(struct channel *, struct rte *rt);
void (*reload_routes)(struct channel *);
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 553e8223..2b065032 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -3097,7 +3097,7 @@ rte_update_in(struct channel *c, const net_addr *n, rte *new, struct rte_src *sr
old->flags &= ~(REF_STALE | REF_DISCARD | REF_MODIFY);
if (c->proto->rte_update_in_notify)
- c->proto->rte_update_in_notify(c->proto, c, net, new, old, src);
+ c->proto->rte_update_in_notify(c, n, old, src);
return 1;
}
@@ -3122,12 +3122,12 @@ rte_update_in(struct channel *c, const net_addr *n, rte *new, struct rte_src *sr
if (!old)
goto drop_withdraw;
- if (c->proto->rte_update_in_notify)
- c->proto->rte_update_in_notify(c->proto, c, net, new, old, src);
-
if (!net->routes)
fib_delete(&tab->fib, net);
+ if (c->proto->rte_update_in_notify)
+ c->proto->rte_update_in_notify(c, n, NULL, src);
+
return 1;
}
@@ -3158,7 +3158,7 @@ rte_update_in(struct channel *c, const net_addr *n, rte *new, struct rte_src *sr
tab->rt_count++;
if (c->proto->rte_update_in_notify)
- c->proto->rte_update_in_notify(c->proto, c, net, new, old, src);
+ c->proto->rte_update_in_notify(c, n, e, src);
return 1;