diff options
Diffstat (limited to 'nest')
-rw-r--r-- | nest/route.h | 5 | ||||
-rw-r--r-- | nest/rt-attr.c | 4 | ||||
-rw-r--r-- | nest/rt-table.c | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/nest/route.h b/nest/route.h index c293fbb1..a2fadf62 100644 --- a/nest/route.h +++ b/nest/route.h @@ -512,8 +512,7 @@ uint ea_hash(ea_list *e); /* Calculate 16-bit hash value */ ea_list *ea_append(ea_list *to, ea_list *what); void ea_format_bitfield(struct eattr *a, byte *buf, int bufsize, const char **names, int min, int max); -#define NEXTHOP_MAX_LABEL_STACK 8 -#define NEXTHOP_MAX_SIZE (sizeof(struct nexthop) + sizeof(u32)*NEXTHOP_MAX_LABEL_STACK) +#define NEXTHOP_MAX_SIZE (sizeof(struct nexthop) + sizeof(u32)*MPLS_MAX_LABEL_STACK) static inline size_t nexthop_size(const struct nexthop *nh) { return sizeof(struct nexthop) + sizeof(u32)*nh->labels; } @@ -528,7 +527,7 @@ int nexthop_is_sorted(struct nexthop *x); void rta_init(void); static inline size_t rta_size(const rta *a) { return sizeof(rta) + sizeof(u32)*a->nh.labels; } -#define RTA_MAX_SIZE (sizeof(rta) + sizeof(u32)*NEXTHOP_MAX_LABEL_STACK) +#define RTA_MAX_SIZE (sizeof(rta) + sizeof(u32)*MPLS_MAX_LABEL_STACK) rta *rta_lookup(rta *); /* Get rta equivalent to this one, uc++ */ static inline int rta_is_cached(rta *r) { return r->aflags & RTAF_CACHED; } static inline rta *rta_clone(rta *r) { r->uc++; return r; } diff --git a/nest/rt-attr.c b/nest/rt-attr.c index 22a5cb14..120a8e24 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -1279,12 +1279,12 @@ rta_init(void) rta_slab_[0] = sl_new(rta_pool, sizeof(rta)); rta_slab_[1] = sl_new(rta_pool, sizeof(rta) + sizeof(u32)); rta_slab_[2] = sl_new(rta_pool, sizeof(rta) + sizeof(u32)*2); - rta_slab_[3] = sl_new(rta_pool, sizeof(rta) + sizeof(u32)*NEXTHOP_MAX_LABEL_STACK); + rta_slab_[3] = sl_new(rta_pool, sizeof(rta) + sizeof(u32)*MPLS_MAX_LABEL_STACK); nexthop_slab_[0] = sl_new(rta_pool, sizeof(struct nexthop)); nexthop_slab_[1] = sl_new(rta_pool, sizeof(struct nexthop) + sizeof(u32)); nexthop_slab_[2] = sl_new(rta_pool, sizeof(struct nexthop) + sizeof(u32)*2); - nexthop_slab_[3] = sl_new(rta_pool, sizeof(struct nexthop) + sizeof(u32)*NEXTHOP_MAX_LABEL_STACK); + nexthop_slab_[3] = sl_new(rta_pool, sizeof(struct nexthop) + sizeof(u32)*MPLS_MAX_LABEL_STACK); rta_alloc_hash(); rte_src_init(); diff --git a/nest/rt-table.c b/nest/rt-table.c index 92542ea8..73b838be 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -2487,7 +2487,7 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm tm, from, primary ? (sync_error ? " !" : " *") : "", info); for (nh = &(a->nh); nh; nh = nh->next) { - char ls[NEXTHOP_MAX_LABEL_STACK*8 + 5]; char *lsp = ls; + char ls[MPLS_MAX_LABEL_STACK*8 + 5]; char *lsp = ls; if (nh->labels) { lsp += bsprintf(lsp, " mpls %d", nh->label[0]); |