From ee196e9a00475a029018181f8d6a00106ee462ce Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Tue, 14 Mar 2023 12:50:22 +0100 Subject: lib: Split flow_alloc from flow_join Better to keep these separate during IRMd revision. Moves the qosspec default out of the protobuf message parsing. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/protobuf.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/lib/protobuf.c') diff --git a/src/lib/protobuf.c b/src/lib/protobuf.c index 0855305f..830efd40 100644 --- a/src/lib/protobuf.c +++ b/src/lib/protobuf.c @@ -301,26 +301,25 @@ struct ipcp_config ipcp_config_msg_to_s(const ipcp_config_msg_t * msg) qosspec_msg_t * qos_spec_s_to_msg(const struct qos_spec * s) { - struct qos_spec spec; qosspec_msg_t * msg; + assert(s != NULL); + msg = malloc(sizeof(*msg)); if (msg == NULL) return NULL; qosspec_msg__init(msg); - spec = (s == NULL ? qos_raw : *s); - - msg->delay = spec.delay; - msg->bandwidth = spec.bandwidth; - msg->availability = spec.availability; - msg->loss = spec.loss; - msg->ber = spec.ber; - msg->in_order = spec.in_order; - msg->max_gap = spec.max_gap; - msg->cypher_s = spec.cypher_s; - msg->timeout = spec.timeout; + msg->delay = s->delay; + msg->bandwidth = s->bandwidth; + msg->availability = s->availability; + msg->loss = s->loss; + msg->ber = s->ber; + msg->in_order = s->in_order; + msg->max_gap = s->max_gap; + msg->cypher_s = s->cypher_s; + msg->timeout = s->timeout; return msg; } -- cgit v1.2.3