summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-10-12 15:19:31 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-10-12 15:19:31 +0000
commit8b3ccc682e88c8e3c90f3b09531e588981cd8e67 (patch)
treebaf690f14125b9229927526b3036c44cdcc1c505 /usr.sbin/bgpd/rde.c
parentb6921a47ea4522b837ff950287e227672fe854db (diff)
Only dump AFI/SAFI pairs that are active. For IPv6 check the announced and
received MP capability for IPv4 this does not work when announce capabilities no is set so check if announce IPv4 none was set in the config. The capabilities code needs rework since those checks are very error prone. With this we don't leak unneeded EOR markers for other AFI/SAFI pairs.
Diffstat (limited to 'usr.sbin/bgpd/rde.c')
-rw-r--r--usr.sbin/bgpd/rde.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index cfe7ab54d0b..0a1dbcd2720 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.269 2009/10/12 13:14:47 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.270 2009/10/12 15:19:30 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -2744,7 +2744,8 @@ peer_dump(u_int32_t id, u_int16_t afi, u_int8_t safi)
}
if (afi == AFI_ALL || afi == AFI_IPv4)
- if (safi == SAFI_ALL || safi == SAFI_UNICAST) {
+ if ((safi == SAFI_ALL || safi == SAFI_UNICAST) &&
+ peer->conf.capabilities.mp_v4 != SAFI_NONE) {
if (peer->conf.announce_type == ANNOUNCE_DEFAULT_ROUTE)
up_generate_default(rules_l, peer, AF_INET);
else
@@ -2755,7 +2756,9 @@ peer_dump(u_int32_t id, u_int16_t afi, u_int8_t safi)
peer_send_eor(peer, AFI_IPv4, SAFI_UNICAST);
}
if (afi == AFI_ALL || afi == AFI_IPv6)
- if (safi == SAFI_ALL || safi == SAFI_UNICAST) {
+ if ((safi == SAFI_ALL || safi == SAFI_UNICAST) &&
+ peer->capa_announced.mp_v6 != SAFI_NONE &&
+ peer->capa_received.mp_v6 != SAFI_NONE) {
if (peer->conf.announce_type == ANNOUNCE_DEFAULT_ROUTE)
up_generate_default(rules_l, peer, AF_INET6);
else