Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
labs
BIRD Internet Routing Daemon
Commits
ccee67ca
Commit
ccee67ca
authored
Dec 08, 2017
by
Ondřej Zajíček
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BGP: Autoconfigure BGP next hops from preferred addresses
parent
830ba75e
Pipeline
#27803
failed with stages
in 5 minutes and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
proto/bgp/bgp.c
proto/bgp/bgp.c
+19
-0
No files found.
proto/bgp/bgp.c
View file @
ccee67ca
...
...
@@ -1504,6 +1504,20 @@ bgp_channel_start(struct channel *C)
c
->
next_hop_addr
=
src
;
}
/* Use preferred addresses associated with interface / source address */
if
(
ipa_zero
(
c
->
next_hop_addr
))
{
/* We know the iface for single-hop, we make lookup for multihop */
struct
neighbor
*
nbr
=
p
->
neigh
?:
neigh_find2
(
&
p
->
p
,
&
src
,
NULL
,
0
);
struct
iface
*
iface
=
nbr
?
nbr
->
iface
:
NULL
;
if
(
bgp_channel_is_ipv4
(
c
)
&&
iface
&&
iface
->
addr4
)
c
->
next_hop_addr
=
iface
->
addr4
->
ip
;
if
(
bgp_channel_is_ipv6
(
c
)
&&
iface
&&
iface
->
addr6
)
c
->
next_hop_addr
=
iface
->
addr6
->
ip
;
}
/* Exit if no feasible next hop address is found */
if
(
ipa_zero
(
c
->
next_hop_addr
))
{
...
...
@@ -2079,6 +2093,11 @@ bgp_show_proto_info(struct proto *P)
{
channel_show_info
(
&
c
->
c
);
if
(
ipa_zero
(
c
->
link_addr
))
cli_msg
(
-
1006
,
" BGP Next hop: %I"
,
c
->
next_hop_addr
);
else
cli_msg
(
-
1006
,
" BGP Next hop: %I %I"
,
c
->
next_hop_addr
,
c
->
link_addr
);
if
(
c
->
igp_table_ip4
)
cli_msg
(
-
1006
,
" IGP IPv4 table: %s"
,
c
->
igp_table_ip4
->
name
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment