diff options
author | Jan Moskyto Matejka <mq@ucw.cz> | 2016-06-13 15:49:53 +0200 |
---|---|---|
committer | Jan Moskyto Matejka <mq@ucw.cz> | 2016-12-22 21:38:33 +0100 |
commit | f2010f9c65ca69584c34c762fb3e5e957958478e (patch) | |
tree | 821f3c498cef0e17feb50e5074ac29854f991175 /nest/rt-attr.c | |
parent | 33ad6e0188b56f682a012ca1b782812c96285d51 (diff) |
Static: Protocol rework wrt. struct nexthop changes; MPLS label support
Diffstat (limited to 'nest/rt-attr.c')
-rw-r--r-- | nest/rt-attr.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nest/rt-attr.c b/nest/rt-attr.c index d3671a53..22a5cb14 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -330,6 +330,9 @@ nexthop_copy(struct nexthop *o) n->iface = o->iface; n->next = NULL; n->weight = o->weight; + n->labels = o->labels; + for (int i=0; i<o->labels; i++) + n->label[i] = o->label[i]; *last = n; last = &(n->next); @@ -1176,6 +1179,12 @@ rta_do_cow(rta *o, linpool *lp) { rta *r = lp_alloc(lp, rta_size(o)); memcpy(r, o, rta_size(o)); + for (struct nexthop **nhn = &(r->nh.next), *nho = o->nh.next; nho; nho = nho->next) + { + *nhn = lp_alloc(lp, nexthop_size(nho)); + memcpy(*nhn, nho, nexthop_size(nho)); + nhn = &((*nhn)->next); + } r->aflags = 0; r->uc = 0; return r; |