1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-30 00:00:11 +01:00

path: fix initialization of reverse path (closes #132)

This commit is contained in:
Steffen Vogel 2017-12-20 11:47:15 +01:00
parent fb3650918c
commit 125054b16b

View file

@ -745,10 +745,18 @@ int path_reverse(struct path *p, struct path *r)
struct path_destination *new_pd = (struct path_destination *) alloc(sizeof(struct path_destination));
struct path_source *new_ps = (struct path_source *) alloc(sizeof(struct path_source));
struct mapping_entry *new_me = alloc(sizeof(struct mapping_entry));
new_pd->node = orig_ps->node;
new_ps->node = orig_pd->node;
new_ps->masked = true;
new_pd->node = orig_ps->node;
new_me->node = new_ps->node;
new_me->type = MAPPING_TYPE_DATA;
new_me->data.offset = 0;
new_me->length = 0;
new_ps->node = orig_pd->node;
list_init(&new_ps->mappings);
list_push(&new_ps->mappings, new_me);
list_push(&r->destinations, new_pd);
list_push(&r->sources, new_ps);