]> git.puffer.fish Git - matthieu/frr.git/commitdiff
BGP: Fix BGP unnumbered peerings across VRFs
authorvivek <vivek@cumulusnetworks.com>
Mon, 28 Mar 2016 16:37:39 +0000 (09:37 -0700)
committervivek <vivek@cumulusnetworks.com>
Mon, 28 Mar 2016 22:12:14 +0000 (15:12 -0700)
Upon receipt of incoming connection, a peer structure (doppelganger) is
created internally and the connection processed for it. The problem is
that in the case of BGP unnumbered, the sockunion structure within BGP was
being updated (in peer_create()) prior to the peer's flags being updated,
so it didn't take into account the 'v6only' configuration. This results
in subsequent problems when bgp_bind() is done - the socket ends up being
bound to the BGP instance instead of the interface.

In the case of an incoming connection, we should just use the addresses
on which the connection was setup/accepted, there is no need to attempt to
derive it again. Further, there is no need to attempt to update addresses
at the time of peer_create() since that is done when the connection is
attempted in bgp_start().

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-10028
Reviewed By: CCR-4373
Testing Done: Manual, bgpsmoke

bgpd/bgp_network.c
bgpd/bgpd.c

index debb87a1fe09e503c03040d9904a51a678901913..b02eabadcae697861a7dd8621d9e6bcb357022c4 100644 (file)
@@ -409,6 +409,7 @@ bgp_accept (struct thread *thread)
 
   peer = peer_create (&su, peer1->conf_if, peer1->bgp, peer1->local_as,
                      peer1->as, peer1->as_type, 0, 0);
+  peer->su = su;
 
   peer_xfer_config(peer, peer1);
   UNSET_FLAG (peer->flags, PEER_FLAG_CONFIG_NODE);
index aa470b73fd8d5a1e08de6500ab99dc1eb71a88cf..478ec856511ec8b05d9f70c2fc26ce77d1dca76c 100644 (file)
@@ -1389,7 +1389,6 @@ peer_create (union sockunion *su, const char *conf_if, struct bgp *bgp,
   if (conf_if)
     {
       peer->conf_if = XSTRDUP (MTYPE_PEER_CONF_IF, conf_if);
-      bgp_peer_conf_if_to_su_update(peer);
       if (peer->host)
        XFREE(MTYPE_BGP_PEER_HOST, peer->host);
       peer->host = XSTRDUP (MTYPE_BGP_PEER_HOST, conf_if);