summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde_update.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-02-18 23:25:18 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-02-18 23:25:18 +0000
commitbe1f22311e554b1b573cad208fe6621c7a89bec9 (patch)
tree14bab02ace4bbe40e40fab90ee349d32d20c717e /usr.sbin/bgpd/rde_update.c
parentfe15af133a0fe1bdd53547fde5b9f37d92204880 (diff)
Do aspath loop detecion for outgoing messages too, but this time with the
remote peer as. OK henning@
Diffstat (limited to 'usr.sbin/bgpd/rde_update.c')
-rw-r--r--usr.sbin/bgpd/rde_update.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/rde_update.c b/usr.sbin/bgpd/rde_update.c
index cbac934cbee..7af1146a6ac 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.4 2004/02/18 16:14:13 claudio Exp $ */
+/* $OpenBSD: rde_update.c,v 1.5 2004/02/18 23:25:17 claudio Exp $ */
/*
* Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
@@ -216,6 +216,15 @@ up_generate_updates(struct rde_peer *peer,
/* Do not send routes back to sender */
return;
+ if (peer->conf.ebgp &&
+ !aspath_loopfree(old->aspath->flags.aspath,
+ peer->conf.remote_as))
+ /*
+ * Do not send routes back to sender which would
+ * cause a aspath loop.
+ */
+ return;
+
if (peer->conf.ebgp == 0 && old->peer->conf.ebgp == 0)
/* Do not redistribute updates to ibgp peers */
return;
@@ -251,6 +260,15 @@ up_generate_updates(struct rde_peer *peer,
/* Do not send routes back to sender */
return;
+ if (peer->conf.ebgp &&
+ !aspath_loopfree(new->aspath->flags.aspath,
+ peer->conf.remote_as))
+ /*
+ * Do not send routes back to sender which would
+ * cause a aspath loop.
+ */
+ return;
+
if (peer->conf.ebgp == 0 && new->peer->conf.ebgp == 0)
/* Do not redistribute updates to ibgp peers */
return;