From: Pavel Tvrdik Date: Thu, 13 Oct 2016 14:57:21 +0000 (+0200) Subject: Clist: The add() function will append a new value X-Git-Tag: v1.6.3~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c09af41;p=thirdparty%2Fbird.git Clist: The add() function will append a new value The add() function used to prepend a new community to clist, but after this fix the add() function appends new community. --- diff --git a/nest/a-set.c b/nest/a-set.c index fde34cabc..bd244e2e3 100644 --- a/nest/a-set.c +++ b/nest/a-set.c @@ -244,9 +244,13 @@ int_set_add(struct linpool *pool, struct adata *list, u32 val) len = list ? list->length : 0; res = lp_alloc(pool, sizeof(struct adata) + len + 4); res->length = len + 4; - * (u32 *) res->data = val; + if (list) - memcpy((char *) res->data + 4, list->data, list->length); + memcpy(res->data, list->data, list->length); + + u32 *c = (u32 *) (res->data + len); + *c = val; + return res; }