ADD_ATTRIBUTE();
- ip = my_address; /* we're it */
+ /* remember the len before adding NEXT_HOP */
+ peer->path_attr_len_without_nexthop = peer->path_attr_len;
+
+ /* NEXT_HOP */
+ a.flags = BGP_PATH_ATTR_FLAG_TRANS;
+ a.code = BGP_PATH_ATTR_CODE_NEXT_HOP;
++ 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));
+
+ ADD_ATTRIBUTE();
+
if (!(peer->path_attrs = malloc(peer->path_attr_len)))
{
LOG(0, 0, 0, "Can't allocate path_attrs for %s (%s)\n",
CONFIG("cluster_hb_timeout", cluster_hb_timeout, INT),
CONFIG("cluster_master_min_adv", cluster_master_min_adv, INT),
CONFIG("ipv6_prefix", ipv6_prefix, IPv6),
+ CONFIG("cli_bind_address", cli_bind_address, IPv4),
+ CONFIG("hostname", hostname, STRING),
+ CONFIG("nexthop_address", nexthop_address, IPv4),
+ CONFIG("nexthop6_address", nexthop6_address, IPv6),
{ NULL, 0, 0, 0 },
};
uint16_t as;
int keepalive;
int hold;
+ struct in_addr update_source;
} neighbour[BGP_NUM_PEERS];
+ in_addr_t nexthop_address;
+ struct in6_addr nexthop6_address;
#endif
} configt;