diff options
author | Maria Matejka <mq@ucw.cz> | 2022-08-31 11:58:27 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-09-01 18:46:40 +0200 |
commit | 7450eea071941c683da158d6dfe8365288eed5b8 (patch) | |
tree | 2c3c7a8251870b0623e89ec0b9ce7deb9000d042 /nest/proto.c | |
parent | 83ceb91b50ae75ee5509faa74e2f6d4bdcf78505 (diff) |
Miscellaneous refactoring
Diffstat (limited to 'nest/proto.c')
-rw-r--r-- | nest/proto.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/nest/proto.c b/nest/proto.c index ef3e3f4d..d2374792 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -450,12 +450,8 @@ channel_start_import(struct channel *c) return; } - int nlen = strlen(c->name) + strlen(c->proto->name) + 2; - char *rn = mb_allocz(c->proto->pool, nlen); - bsprintf(rn, "%s.%s", c->proto->name, c->name); - c->in_req = (struct rt_import_request) { - .name = rn, + .name = mb_sprintf(c->proto->pool, "%s.%s", c->proto->name, c->name), .trace_routes = c->debug | c->proto->debug, .dump_req = channel_dump_import_req, .log_state_change = channel_import_log_state_change, @@ -483,12 +479,9 @@ channel_start_export(struct channel *c) } ASSERT(c->channel_state == CS_UP); - int nlen = strlen(c->name) + strlen(c->proto->name) + 2; - char *rn = mb_allocz(c->proto->pool, nlen); - bsprintf(rn, "%s.%s", c->proto->name, c->name); c->out_req = (struct rt_export_request) { - .name = rn, + .name = mb_sprintf(c->proto->pool, "%s.%s", c->proto->name, c->name), .list = proto_work_list(c->proto), .addr = c->out_subprefix, .addr_mode = c->out_subprefix ? TE_ADDR_IN : TE_ADDR_NONE, |