summaryrefslogtreecommitdiff
path: root/bgpd/bgp_packet.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2012-04-16 16:46:13 +0200
committerDavid Lamparter <equinox@diac24.net>2012-04-16 16:46:17 +0200
commit6e493a44836d3b034ed3421e866878de3fbfcc5b (patch)
tree4edabbbca2126db9aa29b9901ada950c635c17e2 /bgpd/bgp_packet.c
parent9bb5870e26a4089f599b24adf822c4d1a9870a44 (diff)
parent3b381c32fc2c325cc4ffb9f9f30a7e96e9bd87c6 (diff)
bgpd: merge osr/quagga-osr-patches (BZ#700)
this merges a bgp capability negotiation fix where bgpd would fail if no multiprotocol capability was present, but other capabilities were.
Diffstat (limited to 'bgpd/bgp_packet.c')
-rw-r--r--bgpd/bgp_packet.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 5d8087a8..390b5563 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -1152,7 +1152,7 @@ bgp_open_receive (struct peer *peer, bgp_size_t size)
as_t as4 = 0;
struct peer *realpeer;
struct in_addr remote_id;
- int capability;
+ int mp_capability;
u_int8_t notify_data_remote_as[2];
u_int8_t notify_data_remote_id[4];
@@ -1174,7 +1174,7 @@ bgp_open_receive (struct peer *peer, bgp_size_t size)
inet_ntoa (remote_id));
/* BEGIN to read the capability here, but dont do it yet */
- capability = 0;
+ mp_capability = 0;
optlen = stream_getc (peer->ibuf);
if (optlen != 0)
@@ -1459,7 +1459,7 @@ bgp_open_receive (struct peer *peer, bgp_size_t size)
/* Open option part parse. */
if (optlen != 0)
{
- if ((ret = bgp_open_option_parse (peer, optlen, &capability)) < 0)
+ if ((ret = bgp_open_option_parse (peer, optlen, &mp_capability)) < 0)
{
bgp_notify_send (peer,
BGP_NOTIFY_OPEN_ERR,
@@ -1474,8 +1474,13 @@ bgp_open_receive (struct peer *peer, bgp_size_t size)
peer->host);
}
- /* Override capability. */
- if (! capability || CHECK_FLAG (peer->flags, PEER_FLAG_OVERRIDE_CAPABILITY))
+ /*
+ * Assume that the peer supports the locally configured set of
+ * AFI/SAFIs if the peer did not send us any Mulitiprotocol
+ * capabilities, or if 'override-capability' is configured.
+ */
+ if (! mp_capability ||
+ CHECK_FLAG (peer->flags, PEER_FLAG_OVERRIDE_CAPABILITY))
{
peer->afc_nego[AFI_IP][SAFI_UNICAST] = peer->afc[AFI_IP][SAFI_UNICAST];
peer->afc_nego[AFI_IP][SAFI_MULTICAST] = peer->afc[AFI_IP][SAFI_MULTICAST];