summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/bgpd/rde_update.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/usr.sbin/bgpd/rde_update.c b/usr.sbin/bgpd/rde_update.c
index b215f987fce..0d045550371 100644
--- a/usr.sbin/bgpd/rde_update.c
+++ b/usr.sbin/bgpd/rde_update.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_update.c,v 1.82 2014/12/18 19:28:44 tedu Exp $ */
+/* $OpenBSD: rde_update.c,v 1.83 2017/01/23 11:33:41 claudio Exp $ */
/*
* Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -412,6 +412,7 @@ up_generate_updates(struct filter_head *rules, struct rde_peer *peer,
return;
if (new == NULL) {
+withdraw:
if (up_test_update(peer, old) != 1)
return;
@@ -427,8 +428,7 @@ up_generate_updates(struct filter_head *rules, struct rde_peer *peer,
case 1:
break;
case 0:
- up_generate_updates(rules, peer, NULL, old);
- return;
+ goto withdraw;
case -1:
return;
}
@@ -437,17 +437,16 @@ up_generate_updates(struct filter_head *rules, struct rde_peer *peer,
if (rde_filter(rules, &asp, peer, new->aspath, &addr,
new->prefix->prefixlen, new->aspath->peer) == ACTION_DENY) {
path_put(asp);
- up_generate_updates(rules, peer, NULL, old);
- return;
+ goto withdraw;
}
+ if (asp == NULL)
+ asp = new->aspath;
- /* generate update */
- if (asp != NULL) {
- up_generate(peer, asp, &addr, new->prefix->prefixlen);
+ up_generate(peer, asp, &addr, new->prefix->prefixlen);
+
+ /* free modified aspath */
+ if (asp != new->aspath)
path_put(asp);
- } else
- up_generate(peer, new->aspath, &addr,
- new->prefix->prefixlen);
}
}