summaryrefslogtreecommitdiff
path: root/proto/pipe/pipe.c
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2016-06-10 14:34:41 +0200
committerJan Moskyto Matejka <mq@ucw.cz>2016-12-22 13:23:52 +0100
commitec5e5d23faa482495c84163c4ae38d9a31bdc00f (patch)
treedb050c0a90a18b4452630b2929d97d1a9ebe19ef /proto/pipe/pipe.c
parent5b208e296fed0beddce16188478c5119df610d89 (diff)
Nexthop: Support for label stack in nest
Diffstat (limited to 'proto/pipe/pipe.c')
-rw-r--r--proto/pipe/pipe.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c
index 8924c200..a4d371fe 100644
--- a/proto/pipe/pipe.c
+++ b/proto/pipe/pipe.c
@@ -43,6 +43,8 @@
#include "pipe.h"
+#include <alloca.h>
+
static void
pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *old, ea_list *attrs)
{
@@ -51,7 +53,7 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o
struct rte_src *src;
rte *e;
- rta a;
+ rta *a;
if (!new && !old)
return;
@@ -65,12 +67,13 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o
if (new)
{
- memcpy(&a, new->attrs, sizeof(rta));
+ a = alloca(rta_size(new->attrs));
+ memcpy(a, new->attrs, rta_size(new->attrs));
- a.aflags = 0;
- a.eattrs = attrs;
- a.hostentry = NULL;
- e = rte_get_temp(&a);
+ a->aflags = 0;
+ a->eattrs = attrs;
+ a->hostentry = NULL;
+ e = rte_get_temp(a);
e->pflags = 0;
/* Copy protocol specific embedded attributes. */
@@ -78,7 +81,7 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o
e->pref = new->pref;
e->pflags = new->pflags;
- src = a.src;
+ src = a->src;
}
else
{