Skip to content

Commit

Permalink
Adding default as_path for 2 byte asn neighbor
Browse files Browse the repository at this point in the history
With 4 byte asn changes, by default as_path with 4 byte asn
was being added. It should be as_path with 2 byte asn if the
peer does not support 4 byte asn.

Change-Id: Ic1cf113613a36615797cb985b1a3f4199e2fd663
Closes-Bug: #218663
  • Loading branch information
bansalnikhil committed Dec 20, 2018
1 parent 6978dda commit 9ccd1ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/bgp/bgp_table.cc
Expand Up @@ -25,9 +25,7 @@
#include "bgp/tunnel_encap/tunnel_encap.h"
#include "net/community_type.h"

using std::map;
using std::make_pair;
using std::ostringstream;
using std::string;

class BgpTable::DeleteActor : public LifetimeActor {
Expand Down Expand Up @@ -586,10 +584,14 @@ UpdateInfo *BgpTable::GetUpdateInfo(RibOut *ribout, BgpRoute *route,
// then generate a Nil AsPath i.e. one with 0 length. No need
// to modify the AsPath if it already exists since this is an
// iBGP RibOut.
if (clone->aspath_4byte() == NULL) {
if (ribout->as4_supported() && !clone->aspath_4byte()) {
AsPath4ByteSpec as_path;
clone->set_aspath_4byte(&as_path);
}
if (!ribout->as4_supported() && !clone->as_path()) {
AsPathSpec as_path;
clone->set_as_path(&as_path);
}
} else if (ribout->peer_type() == BgpProto::EBGP) {
// Don't advertise routes from non-master instances if there's
// no nexthop. The ribout has to be for bgpaas-clients because
Expand Down

0 comments on commit 9ccd1ba

Please sign in to comment.