NULL, 0);
}
+void
+lde_change_host_label(int af)
+{
+ struct lde_nbr *ln;
+ struct fec *f;
+ struct fec_node *fn;
+ uint32_t new_label;
+
+ RB_FOREACH(f, fec_tree, &ft) {
+ fn = (struct fec_node *)f;
+
+ switch (af) {
+ case AF_INET:
+ if (fn->fec.type != FEC_TYPE_IPV4)
+ continue;
+ break;
+ case AF_INET6:
+ if (fn->fec.type != FEC_TYPE_IPV6)
+ continue;
+ break;
+ default:
+ fatalx("lde_change_host_label: unknown af");
+ }
+
+ /*
+ * If the local label has changed to NO_LABEL, send a label
+ * withdraw to all peers.
+ * If the local label has changed and it's different from
+ * NO_LABEL, send a label mapping to all peers advertising
+ * the new label.
+ * If the local label hasn't changed, do nothing
+ */
+ new_label = lde_update_label(fn);
+ if (fn->local_label != new_label) {
+ if (new_label == NO_LABEL)
+ RB_FOREACH(ln, nbr_tree, &lde_nbrs)
+ lde_send_labelwithdraw(ln, fn,
+ NULL, NULL);
+
+ fn->local_label = new_label;
+ if (fn->local_label != NO_LABEL)
+ RB_FOREACH(ln, nbr_tree, &lde_nbrs)
+ lde_send_labelmapping(ln, fn, 0);
+ }
+ }
+ RB_FOREACH(ln, nbr_tree, &lde_nbrs)
+ lde_imsg_compose_ldpe(IMSG_MAPPING_ADD_END, ln->peerid, 0,
+ NULL, 0);
+}
+
static int
lde_address_add(struct lde_nbr *ln, struct lde_addr *lde_addr)
{
struct lde_wdraw *lde_wdraw_add(struct lde_nbr *, struct fec_node *);
void lde_wdraw_del(struct lde_nbr *, struct lde_wdraw *);
void lde_change_egress_label(int);
+void lde_change_host_label(int);
struct lde_addr *lde_address_find(struct lde_nbr *, int,
union ldpd_addr *);
int stop_init_backoff = 0;
int remove_dynamic_tnbrs = 0;
int change_egress_label = 0;
+ int change_host_label = 0;
int reset_nbrs_ipv4 = 0;
int reset_nbrs = 0;
int update_sockets = 0;
if ((af_conf->flags & F_LDPD_AF_EXPNULL) !=
(xa->flags & F_LDPD_AF_EXPNULL))
change_egress_label = 1;
+
+ /* changing config of host only fec filtering */
+ if ((af_conf->flags & F_LDPD_AF_ALLOCHOSTONLY)
+ != (xa->flags & F_LDPD_AF_ALLOCHOSTONLY))
+ change_host_label = 1;
+
af_conf->flags = xa->flags;
/* update the transport address */
}
/* update ACLs */
+ if (strcmp(af_conf->acl_label_allocate_for,
+ xa->acl_label_allocate_for))
+ change_host_label = 1;
+
if (strcmp(af_conf->acl_label_advertise_to,
xa->acl_label_advertise_to) ||
strcmp(af_conf->acl_label_advertise_for,
case PROC_LDE_ENGINE:
if (change_egress_label)
lde_change_egress_label(af);
+ if (change_host_label)
+ lde_change_host_label(af);
break;
case PROC_LDP_ENGINE:
if (stop_init_backoff)