return 1;
}
-mpls_label_t bgp_adv_label(struct bgp_node *rn, struct bgp_info *ri,
+mpls_label_t bgp_adv_label(struct bgp_node *rn, struct bgp_path_info *pi,
struct peer *to, afi_t afi, safi_t safi)
{
struct peer *from;
mpls_label_t remote_label;
int reflect;
- if (!rn || !ri || !to)
+ if (!rn || !pi || !to)
return MPLS_INVALID_LABEL;
- remote_label = ri->extra ? ri->extra->label[0] : MPLS_INVALID_LABEL;
- from = ri->peer;
+ remote_label = pi->extra ? pi->extra->label[0] : MPLS_INVALID_LABEL;
+ from = pi->peer;
reflect =
((from->sort == BGP_PEER_IBGP) && (to->sort == BGP_PEER_IBGP));
return rn->local_label;
}
-void bgp_reg_dereg_for_label(struct bgp_node *rn, struct bgp_info *ri, int reg)
+void bgp_reg_dereg_for_label(struct bgp_node *rn, struct bgp_path_info *pi,
+ int reg)
{
struct stream *s;
struct prefix *p;
stream_putw(s, PREFIX_FAMILY(p));
stream_put_prefix(s, p);
if (reg) {
- assert(ri);
- if (ri->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PREFIX_SID)) {
- if (ri->attr->label_index != BGP_INVALID_LABEL_INDEX) {
+ assert(pi);
+ if (pi->attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PREFIX_SID)) {
+ if (pi->attr->label_index != BGP_INVALID_LABEL_INDEX) {
flags |= ZEBRA_FEC_REGISTER_LABEL_INDEX;
- stream_putl(s, ri->attr->label_index);
+ stream_putl(s, pi->attr->label_index);
}
}
SET_FLAG(rn->flags, BGP_NODE_REGISTERED_FOR_LABEL);
/* If we RX multiple labels we will end up keeping only the last
* one. We do not yet support a label stack greater than 1. */
if (label_depth > 1)
- zlog_warn("%s rcvd UPDATE with label stack %d deep", peer->host,
+ zlog_info("%s rcvd UPDATE with label stack %d deep", peer->host,
label_depth);
if (!(bgp_is_withdraw_label(label) || label_bos(label)))
- zlog_warn(
+ flog_warn(
+ EC_BGP_INVALID_LABEL_STACK,
"%s rcvd UPDATE with invalid label stack - no bottom of stack",
peer->host);
/* sanity check against packet data */
if ((pnt + psize) > lim) {
flog_err(
- BGP_ERR_UPDATE_RCV,
+ EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error / L-U (prefix length %d exceeds packet size %u)",
peer->host, prefixlen, (uint)(lim - pnt));
return -1;
/* There needs to be at least one label */
if (prefixlen < 24) {
- flog_err(BGP_ERR_UPDATE_RCV,
- "%s [Error] Update packet error"
- " (wrong label length %d)",
- peer->host, prefixlen);
+ flog_err(EC_BGP_UPDATE_RCV,
+ "%s [Error] Update packet error"
+ " (wrong label length %d)",
+ peer->host, prefixlen);
bgp_notify_send(peer, BGP_NOTIFY_UPDATE_ERR,
BGP_NOTIFY_UPDATE_INVAL_NETWORK);
return -1;
* ignored.
*/
flog_err(
- BGP_ERR_UPDATE_RCV,
+ EC_BGP_UPDATE_RCV,
"%s: IPv4 labeled-unicast NLRI is multicast address %s, ignoring",
peer->host, inet_ntoa(p.u.prefix4));
continue;
char buf[BUFSIZ];
flog_err(
- BGP_ERR_UPDATE_RCV,
+ EC_BGP_UPDATE_RCV,
"%s: IPv6 labeled-unicast NLRI is link-local address %s, ignoring",
peer->host,
inet_ntop(AF_INET6, &p.u.prefix6, buf,
char buf[BUFSIZ];
flog_err(
- BGP_ERR_UPDATE_RCV,
+ EC_BGP_UPDATE_RCV,
"%s: IPv6 unicast NLRI is multicast address %s, ignoring",
peer->host,
inet_ntop(AF_INET6, &p.u.prefix6, buf,
/* Packet length consistency check. */
if (pnt != lim) {
flog_err(
- BGP_ERR_UPDATE_RCV,
+ EC_BGP_UPDATE_RCV,
"%s [Error] Update packet error / L-U (%zu data remaining after parsing)",
peer->host, lim - pnt);
return -1;