Add a config option to set the advertised BGP next hop.

Signed-off-by: Benjamin Cama <benoar@dolka.fr>
This commit is contained in:
Benjamin Cama 2011-07-07 13:12:30 +02:00
parent 4f1a9aa378
commit 8c4f3bfe79
3 changed files with 10 additions and 1 deletions

9
bgp.c
View file

@ -195,7 +195,14 @@ int bgp_start(struct bgp_peer *peer, char *name, int as, int keepalive,
/* NEXT_HOP */
a.flags = BGP_PATH_ATTR_FLAG_TRANS;
a.code = BGP_PATH_ATTR_CODE_NEXT_HOP;
ip = my_address; /* we're it */
if (config->nexthop_address)
{
ip = config->nexthop_address;
}
else
{
ip = my_address; /* we're it */
}
a.data.s.len = sizeof(ip);
memcpy(a.data.s.value, &ip, sizeof(ip));