]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Postpone setting link_addr
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 2 Jan 2019 14:57:14 +0000 (15:57 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 2 Jan 2019 14:57:14 +0000 (15:57 +0100)
It may happen that the LLv6 address for given iface is not defined during
BGP start, so we postpone the check to the the session establishment.

proto/bgp/bgp.c

index fb6c9881f58045886b7d332c465ead575430304b..ceeec7270e64a080149a650a12a1b3d9bb412d27 100644 (file)
@@ -505,6 +505,10 @@ bgp_conn_enter_established_state(struct bgp_conn *conn)
   if (ipa_zero(p->source_addr))
     p->source_addr = conn->sk->saddr;
 
+  /* In case of LLv6 is not valid during BGP start */
+  if (ipa_zero(p->link_addr) && p->neigh && p->neigh->iface && p->neigh->iface->llv6)
+    p->link_addr = p->neigh->iface->llv6->ip;
+
   conn->sk->fast_rx = 0;
 
   p->conn = conn;