diff --git a/daemon/cli.c b/daemon/cli.c index c19bd386a..7d7a6432f 100644 --- a/daemon/cli.c +++ b/daemon/cli.c @@ -1255,7 +1255,7 @@ static void cli_free(void *p) { streambuf_listener_shutdown(&c->listener); } -struct cli *cli_new(endpoint_t *ep) { +struct cli *cli_new(const endpoint_t *ep) { struct cli *c; c = obj_alloc0("cli", sizeof(*c), cli_free); diff --git a/daemon/control_ng.c b/daemon/control_ng.c index 954eae439..6ea0ed12f 100644 --- a/daemon/control_ng.c +++ b/daemon/control_ng.c @@ -533,7 +533,7 @@ void control_ng_free(void *p) { g_hash_table_destroy(tcp_connections_hash); } -struct control_ng *control_ng_new(endpoint_t *ep, unsigned char tos) { +struct control_ng *control_ng_new(const endpoint_t *ep) { struct control_ng *c; c = obj_alloc0("control_ng", sizeof(*c), control_ng_free); @@ -542,8 +542,8 @@ struct control_ng *control_ng_new(endpoint_t *ep, unsigned char tos) { if (udp_listener_init(&c->udp_listener, ep, control_ng_incoming, &c->obj)) goto fail2; - if (tos) - set_tos(&c->udp_listener, tos); + if (rtpe_config.control_tos) + set_tos(&c->udp_listener, rtpe_config.control_tos); if (rtpe_config.control_pmtu) set_pmtu_disc(&c->udp_listener, rtpe_config.control_pmtu == PMTU_DISC_WANT ? IP_PMTUDISC_WANT : IP_PMTUDISC_DONT); @@ -554,7 +554,7 @@ fail2: return NULL; } -struct control_ng *control_ng_tcp_new(endpoint_t *ep) { +struct control_ng *control_ng_tcp_new(const endpoint_t *ep) { struct control_ng * ctrl_ng = obj_alloc0("control_ng", sizeof(*ctrl_ng), NULL); ctrl_ng->udp_listener.fd = -1; diff --git a/daemon/control_tcp.c b/daemon/control_tcp.c index e1859dd05..d4b680838 100644 --- a/daemon/control_tcp.c +++ b/daemon/control_tcp.c @@ -151,7 +151,7 @@ static void control_tcp_free(void *p) { pcre_free_study(c->parse_ree); } -struct control_tcp *control_tcp_new(endpoint_t *ep) { +struct control_tcp *control_tcp_new(const endpoint_t *ep) { struct control_tcp *c; const char *errptr; int erroff; diff --git a/daemon/control_udp.c b/daemon/control_udp.c index 0443bc510..63a2995bd 100644 --- a/daemon/control_udp.c +++ b/daemon/control_udp.c @@ -142,7 +142,7 @@ void control_udp_free(void *p) { cookie_cache_cleanup(&u->cookie_cache); } -struct control_udp *control_udp_new(endpoint_t *ep) { +struct control_udp *control_udp_new(const endpoint_t *ep) { struct control_udp *c; const char *errptr; int erroff; diff --git a/daemon/main.c b/daemon/main.c index d124da736..339cd6964 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -1157,15 +1157,13 @@ no_kernel: if (rtpe_config.ng_listen_ep[0].port) { interfaces_exclude_port(rtpe_config.ng_listen_ep[0].port); - rtpe_control_ng[0] = control_ng_new(&rtpe_config.ng_listen_ep[0], - rtpe_config.control_tos); + rtpe_control_ng[0] = control_ng_new(&rtpe_config.ng_listen_ep[0]); if (!rtpe_control_ng[0]) die("Failed to open UDP NG control connection port (%s): %s", endpoint_print_buf(&rtpe_config.ng_listen_ep[0]), strerror(errno)); if (rtpe_config.ng_listen_ep[1].port) { - rtpe_control_ng[1] = control_ng_new(&rtpe_config.ng_listen_ep[1], - rtpe_config.control_tos); + rtpe_control_ng[1] = control_ng_new(&rtpe_config.ng_listen_ep[1]); if (!rtpe_control_ng[1]) die("Failed to open UDP NG control connection port (%s): %s", endpoint_print_buf(&rtpe_config.ng_listen_ep[1]), diff --git a/include/cli.h b/include/cli.h index 5562124ba..61a0c30b9 100644 --- a/include/cli.h +++ b/include/cli.h @@ -22,7 +22,7 @@ struct cli_writer { struct call_monologue *ml; }; -struct cli *cli_new(endpoint_t *); +struct cli *cli_new(const endpoint_t *); void cli_handle(str *instr, struct cli_writer *); diff --git a/include/control_ng.h b/include/control_ng.h index b52f11743..b90814a3d 100644 --- a/include/control_ng.h +++ b/include/control_ng.h @@ -65,8 +65,8 @@ struct ng_buffer { extern const char *ng_command_strings[NGC_COUNT]; extern const char *ng_command_strings_short[NGC_COUNT]; -struct control_ng *control_ng_new(endpoint_t *, unsigned char); -struct control_ng *control_ng_tcp_new(endpoint_t *); +struct control_ng *control_ng_new(const endpoint_t *); +struct control_ng *control_ng_tcp_new(const endpoint_t *); void notify_ng_tcp_clients(str *); void control_ng_init(void); void control_ng_cleanup(void); diff --git a/include/control_tcp.h b/include/control_tcp.h index e6bf9a0c8..264073b9d 100644 --- a/include/control_tcp.h +++ b/include/control_tcp.h @@ -34,7 +34,7 @@ struct streambuf_stream; -struct control_tcp *control_tcp_new(endpoint_t *); +struct control_tcp *control_tcp_new(const endpoint_t *); diff --git a/include/control_udp.h b/include/control_udp.h index 418e7f2db..6e4276a55 100644 --- a/include/control_udp.h +++ b/include/control_udp.h @@ -55,7 +55,7 @@ struct control_udp { -struct control_udp *control_udp_new(endpoint_t *); +struct control_udp *control_udp_new(const endpoint_t *);