]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Free bind applies also to outbound connections
authorMaria Matejka <mq@ucw.cz>
Thu, 16 Mar 2023 18:23:19 +0000 (19:23 +0100)
committerMaria Matejka <mq@ucw.cz>
Thu, 16 Mar 2023 18:23:33 +0000 (19:23 +0100)
Even though the free bind option is primarily meant to alleviate problems
with addresses assigned too late, it's also possible to use BIRD with AnyIP
configuration, assigning whole ranges to the machine. Therefore free bind
allows also to create an outbound connection from specific address even though
such address is not assigned.

proto/bgp/bgp.c

index a0e83415f03defc8e562406f68d878f83c71bd4b..9408715e5523ead3e4337a64e6892a5cc5a1c73e 100644 (file)
@@ -1109,6 +1109,7 @@ bgp_connect(struct bgp_proto *p)  /* Enter Connect state and start establishing c
   s->tos = IP_PREC_INTERNET_CONTROL;
   s->password = p->cf->password;
   s->tx_hook = bgp_connected;
+  s->flags = p->cf->free_bind ? SKF_FREEBIND : 0;
   BGP_TRACE(D_EVENTS, "Connecting to %I%J from local address %I%J",
            s->daddr, ipa_is_link_local(s->daddr) ? p->cf->iface : NULL,
            s->saddr, ipa_is_link_local(s->saddr) ? s->iface : NULL);