*/
if (!v6_ll_avail && if_is_loopback(ifp))
v6_ll_avail = true;
+ else {
+ flog_warn(
+ EC_BGP_NO_LL_ADDRESS_AVAILABLE,
+ "Interface: %s does not have a v6 LL address associated with it, waiting until one is created for it",
+ ifp->name);
+ }
} else
/* Link-local address. */
{
static uint32_t bgp_tm_min, bgp_tm_max, bgp_tm_chunk_size;
struct bgp *bgp_tm_bgp;
-static int bgp_zebra_tm_connect(struct thread *t)
+static void bgp_zebra_tm_connect(struct thread *t)
{
struct zclient *zclient;
int delay = 10, ret = 0;
}
thread_add_timer(bm->master, bgp_zebra_tm_connect, zclient, delay,
&bgp_tm_thread_connect);
- return 0;
}
bool bgp_zebra_tm_chunk_obtained(void)
struct bgp_path_info *mpinfo_cp = &local_info;
route_tag_t tag;
mpls_label_t label;
+ struct bgp_sid_info *sid_info;
int nh_othervrf = 0;
bool is_evpn;
bool nh_updated = false;
if (mpinfo->extra && !sid_zero(&mpinfo->extra->sid[0].sid)
&& !CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE)) {
- memcpy(&api_nh->seg6_segs, &mpinfo->extra->sid[0].sid,
+ sid_info = &mpinfo->extra->sid[0];
+
+ memcpy(&api_nh->seg6_segs, &sid_info->sid,
sizeof(api_nh->seg6_segs));
+ if (sid_info->transposition_len != 0) {
+ if (!bgp_is_valid_label(
+ &mpinfo->extra->label[0]))
+ continue;
+
+ label = label_pton(&mpinfo->extra->label[0]);
+ transpose_sid(&api_nh->seg6_segs, label,
+ sid_info->transposition_offset,
+ sid_info->transposition_len);
+ }
+
SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_SEG6);
}
sizeof(bzo.aspath));
if (info->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_COMMUNITIES))
- strlcpy(bzo.community, info->attr->community->str,
+ strlcpy(bzo.community,
+ bgp_attr_get_community(info->attr)->str,
sizeof(bzo.community));
if (info->attr->flag
ifindex_t svi_ifindex;
bool is_anycast_mac = false;
- memset(&svi_rmac, 0, sizeof(struct ethaddr));
- memset(&originator_ip, 0, sizeof(struct in_addr));
+ memset(&svi_rmac, 0, sizeof(svi_rmac));
+ memset(&originator_ip, 0, sizeof(originator_ip));
s = zclient->ibuf;
l3vni = stream_getl(s);
if (cmd == ZEBRA_L3VNI_ADD) {
struct bgp *bgp_vrf = NULL;
struct prefix p;
- memset(&p, 0, sizeof(struct prefix));
+ memset(&p, 0, sizeof(p));
s = zclient->ibuf;
stream_get(&p, s, sizeof(struct prefix));
struct stream *s = NULL;
struct bgp *bgp = bgp_get_default();
struct listnode *node;
- struct prefix_ipv6 *c;
- struct srv6_locator_chunk s6c = {};
- struct prefix_ipv6 *chunk = NULL;
+ struct srv6_locator_chunk *c;
+ struct srv6_locator_chunk *chunk = srv6_locator_chunk_alloc();
s = zclient->ibuf;
- zapi_srv6_locator_chunk_decode(s, &s6c);
+ zapi_srv6_locator_chunk_decode(s, chunk);
- if (strcmp(bgp->srv6_locator_name, s6c.locator_name) != 0) {
+ if (strcmp(bgp->srv6_locator_name, chunk->locator_name) != 0) {
zlog_err("%s: Locator name unmatch %s:%s", __func__,
- bgp->srv6_locator_name, s6c.locator_name);
+ bgp->srv6_locator_name, chunk->locator_name);
+ srv6_locator_chunk_free(chunk);
return 0;
}
for (ALL_LIST_ELEMENTS_RO(bgp->srv6_locator_chunks, node, c)) {
- if (!prefix_cmp(c, &s6c.prefix))
+ if (!prefix_cmp(&c->prefix, &chunk->prefix)) {
+ srv6_locator_chunk_free(chunk);
return 0;
+ }
}
- chunk = prefix_ipv6_new();
- *chunk = s6c.prefix;
listnode_add(bgp->srv6_locator_chunks, chunk);
vpn_leak_postchange_all();
return 0;
struct srv6_locator loc = {};
struct bgp *bgp = bgp_get_default();
struct listnode *node, *nnode;
- struct prefix_ipv6 *chunk;
+ struct srv6_locator_chunk *chunk;
struct bgp_srv6_function *func;
struct bgp *bgp_vrf;
struct in6_addr *tovpn_sid;
// refresh chunks
for (ALL_LIST_ELEMENTS(bgp->srv6_locator_chunks, node, nnode, chunk))
if (prefix_match((struct prefix *)&loc.prefix,
- (struct prefix *)chunk))
+ (struct prefix *)&chunk->prefix))
listnode_delete(bgp->srv6_locator_chunks, chunk);
// refresh functions
if (!vrf_is_backend_netns() && bgp->vrf_id != nh->vrf_id)
return;
- memset(&p, 0, sizeof(struct prefix));
+ memset(&p, 0, sizeof(p));
if (afi != AFI_IP && afi != AFI_IP6)
return;
p.family = afi2family(afi);
/* Check if capability is already sent. If the flag force is set
* send the capability since this can be initial bgp configuration
*/
- memset(&api, 0, sizeof(struct zapi_cap));
+ memset(&api, 0, sizeof(api));
if (disable) {
api.cap = ZEBRA_CLIENT_GR_DISABLE;
api.vrf_id = bgp->vrf_id;
return BGP_GR_FAILURE;
}
- memset(&api, 0, sizeof(struct zapi_cap));
+ memset(&api, 0, sizeof(api));
api.cap = ZEBRA_CLIENT_RIB_STALE_TIME;
api.stale_removal_time = bgp->rib_stale_time;
api.vrf_id = bgp->vrf_id;