Skip to content

Commit cedddc1

Browse files
flichtenheldcron2
authored andcommitted
Remove various unused function parameters
Change-Id: Ia3b0f22b0049a111ce52b3c87dd08a843ea9a919 Signed-off-by: Frank Lichtenheld <[email protected]> Acked-by: Gert Doering <[email protected]> Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg31064.html Signed-off-by: Gert Doering <[email protected]>
1 parent e4f4431 commit cedddc1

File tree

18 files changed

+42
-67
lines changed

18 files changed

+42
-67
lines changed

src/openvpn/forward.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,11 @@ parse_incoming_control_channel_command(struct context *c, struct buffer *buf)
257257
}
258258
else if (buf_string_match_head_str(buf, "INFO_PRE"))
259259
{
260-
server_pushed_info(c, buf, 8);
260+
server_pushed_info(buf, 8);
261261
}
262262
else if (buf_string_match_head_str(buf, "INFO"))
263263
{
264-
server_pushed_info(c, buf, 4);
264+
server_pushed_info(buf, 4);
265265
}
266266
else if (buf_string_match_head_str(buf, "CR_RESPONSE"))
267267
{

src/openvpn/multi.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,8 +1769,7 @@ multi_client_connect_mda(struct multi_context *m,
17691769
}
17701770

17711771
static void
1772-
multi_client_connect_setenv(struct multi_context *m,
1773-
struct multi_instance *mi)
1772+
multi_client_connect_setenv(struct multi_instance *mi)
17741773
{
17751774
struct gc_arena gc = gc_new();
17761775

@@ -2565,7 +2564,7 @@ multi_client_connect_early_setup(struct multi_context *m,
25652564
/* do --client-connect setenvs */
25662565
multi_select_virtual_addr(m, mi);
25672566

2568-
multi_client_connect_setenv(m, mi);
2567+
multi_client_connect_setenv(mi);
25692568
}
25702569

25712570
/**
@@ -2658,7 +2657,7 @@ multi_client_connect_source_ccd(struct multi_context *m,
26582657
*/
26592658
multi_select_virtual_addr(m, mi);
26602659

2661-
multi_client_connect_setenv(m, mi);
2660+
multi_client_connect_setenv(mi);
26622661

26632662
ret = CC_RET_SUCCEEDED;
26642663
}
@@ -2930,7 +2929,6 @@ static void
29302929
multi_bcast(struct multi_context *m,
29312930
const struct buffer *buf,
29322931
const struct multi_instance *sender_instance,
2933-
const struct mroute_addr *sender_addr,
29342932
uint16_t vid)
29352933
{
29362934
struct hash_iterator hi;
@@ -3458,7 +3456,7 @@ multi_process_incoming_link(struct multi_context *m, struct multi_instance *inst
34583456
if (mroute_flags & MROUTE_EXTRACT_MCAST)
34593457
{
34603458
/* for now, treat multicast as broadcast */
3461-
multi_bcast(m, &c->c2.to_tun, m->pending, NULL, 0);
3459+
multi_bcast(m, &c->c2.to_tun, m->pending, 0);
34623460
}
34633461
else /* possible client to client routing */
34643462
{
@@ -3510,8 +3508,7 @@ multi_process_incoming_link(struct multi_context *m, struct multi_instance *inst
35103508
{
35113509
if (mroute_flags & (MROUTE_EXTRACT_BCAST|MROUTE_EXTRACT_MCAST))
35123510
{
3513-
multi_bcast(m, &c->c2.to_tun, m->pending, NULL,
3514-
vid);
3511+
multi_bcast(m, &c->c2.to_tun, m->pending, vid);
35153512
}
35163513
else /* try client-to-client routing */
35173514
{
@@ -3604,7 +3601,7 @@ multi_process_incoming_tun(struct multi_context *m, const unsigned int mpp_flags
36043601
if (mroute_flags & (MROUTE_EXTRACT_BCAST|MROUTE_EXTRACT_MCAST))
36053602
{
36063603
/* for now, treat multicast as broadcast */
3607-
multi_bcast(m, &m->top.c2.buf, NULL, NULL, vid);
3604+
multi_bcast(m, &m->top.c2.buf, NULL, vid);
36083605
}
36093606
else
36103607
{
@@ -3776,7 +3773,7 @@ gremlin_flood_clients(struct multi_context *m)
37763773

37773774
for (i = 0; i < parm.n_packets; ++i)
37783775
{
3779-
multi_bcast(m, &buf, NULL, NULL, 0);
3776+
multi_bcast(m, &buf, NULL, 0);
37803777
}
37813778

37823779
gc_free(&gc);

src/openvpn/options.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,6 @@ static struct http_proxy_options *
21372137
parse_http_proxy_override(const char *server,
21382138
const char *port,
21392139
const char *flags,
2140-
const int msglevel,
21412140
struct gc_arena *gc)
21422141
{
21432142
if (server && port)
@@ -2307,7 +2306,7 @@ alloc_pull_filter_list(struct options *o)
23072306
}
23082307

23092308
static struct pull_filter *
2310-
alloc_pull_filter(struct options *o, const int msglevel)
2309+
alloc_pull_filter(struct options *o)
23112310
{
23122311
struct pull_filter_list *l = alloc_pull_filter_list(o);
23132312
struct pull_filter *f;
@@ -6345,7 +6344,7 @@ add_option(struct options *options,
63456344
else if (streq(p[0], "http-proxy-override") && p[1] && p[2] && !p[4])
63466345
{
63476346
VERIFY_PERMISSION(OPT_P_GENERAL);
6348-
options->http_proxy_override = parse_http_proxy_override(p[1], p[2], p[3], msglevel, &options->gc);
6347+
options->http_proxy_override = parse_http_proxy_override(p[1], p[2], p[3], &options->gc);
63496348
if (!options->http_proxy_override)
63506349
{
63516350
goto err;
@@ -7259,7 +7258,7 @@ add_option(struct options *options,
72597258
{
72607259
struct pull_filter *f;
72617260
VERIFY_PERMISSION(OPT_P_GENERAL)
7262-
f = alloc_pull_filter(options, msglevel);
7261+
f = alloc_pull_filter(options);
72637262

72647263
if (strcmp("accept", p[1]) == 0)
72657264
{

src/openvpn/proxy.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,7 @@ http_proxy_close(struct http_proxy_info *hp)
573573
static bool
574574
add_proxy_headers(struct http_proxy_info *p,
575575
socket_descriptor_t sd, /* already open to proxy */
576-
const char *host, /* openvpn server remote */
577-
const char *port /* openvpn server port */
576+
const char *host /* openvpn server remote */
578577
)
579578
{
580579
char buf[512];
@@ -694,7 +693,7 @@ establish_http_proxy_passthru(struct http_proxy_info *p,
694693
goto error;
695694
}
696695

697-
if (!add_proxy_headers(p, sd, host, port))
696+
if (!add_proxy_headers(p, sd, host))
698697
{
699698
goto error;
700699
}
@@ -833,7 +832,7 @@ establish_http_proxy_passthru(struct http_proxy_info *p,
833832
}
834833

835834
/* send HOST etc, */
836-
if (!add_proxy_headers(p, sd, host, port))
835+
if (!add_proxy_headers(p, sd, host))
837836
{
838837
goto error;
839838
}
@@ -959,7 +958,7 @@ establish_http_proxy_passthru(struct http_proxy_info *p,
959958
}
960959

961960
/* send HOST etc, */
962-
if (!add_proxy_headers(p, sd, host, port))
961+
if (!add_proxy_headers(p, sd, host))
963962
{
964963
goto error;
965964
}

src/openvpn/push.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ receive_exit_message(struct context *c)
226226

227227

228228
void
229-
server_pushed_info(struct context *c, const struct buffer *buffer,
230-
const int adv)
229+
server_pushed_info(const struct buffer *buffer, const int adv)
231230
{
232231
const char *m = "";
233232
struct buffer buf = *buffer;
@@ -259,7 +258,7 @@ server_pushed_info(struct context *c, const struct buffer *buffer,
259258

260259
gc_free(&gc);
261260
}
262-
#endif
261+
#endif
263262
msg(D_PUSH, "Info command was pushed by server ('%s')", m);
264263
}
265264

src/openvpn/push.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ void server_pushed_signal(struct context *c, const struct buffer *buffer, const
5050

5151
void receive_exit_message(struct context *c);
5252

53-
void server_pushed_info(struct context *c, const struct buffer *buffer,
54-
const int adv);
53+
void server_pushed_info(const struct buffer *buffer, const int adv);
5554

5655
void receive_cr_response(struct context *c, const struct buffer *buffer);
5756

src/openvpn/route.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ add_routes(struct route_list *rl, struct route_ipv6_list *rl6,
12431243
{
12441244
if (flags & ROUTE_DELETE_FIRST)
12451245
{
1246-
delete_route_ipv6(r, tt, flags, es, ctx);
1246+
delete_route_ipv6(r, tt, es, ctx);
12471247
}
12481248
ret = add_route_ipv6(r, tt, flags, es, ctx) && ret;
12491249
}
@@ -1280,7 +1280,7 @@ delete_routes(struct route_list *rl, struct route_ipv6_list *rl6,
12801280
struct route_ipv6 *r6;
12811281
for (r6 = rl6->routes_ipv6; r6; r6 = r6->next)
12821282
{
1283-
delete_route_ipv6(r6, tt, flags, es, ctx);
1283+
delete_route_ipv6(r6, tt, es, ctx);
12841284
}
12851285
rl6->iflags &= ~RL_ROUTES_ADDED;
12861286
}
@@ -2383,7 +2383,7 @@ delete_route(struct route_ipv4 *r,
23832383

23842384
void
23852385
delete_route_ipv6(const struct route_ipv6 *r6, const struct tuntap *tt,
2386-
unsigned int flags, const struct env_set *es,
2386+
const struct env_set *es,
23872387
openvpn_net_ctx_t *ctx)
23882388
{
23892389
const char *network;

src/openvpn/route.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ void route_ipv6_clear_host_bits( struct route_ipv6 *r6 );
280280

281281
bool add_route_ipv6(struct route_ipv6 *r, const struct tuntap *tt, unsigned int flags, const struct env_set *es, openvpn_net_ctx_t *ctx);
282282

283-
void delete_route_ipv6(const struct route_ipv6 *r, const struct tuntap *tt, unsigned int flags, const struct env_set *es, openvpn_net_ctx_t *ctx);
283+
void delete_route_ipv6(const struct route_ipv6 *r, const struct tuntap *tt, const struct env_set *es, openvpn_net_ctx_t *ctx);
284284

285285
bool add_route(struct route_ipv4 *r, const struct tuntap *tt, unsigned int flags,
286286
const struct route_gateway_info *rgi, const struct env_set *es,

src/openvpn/socket.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,6 @@ phase2_socks_client(struct link_socket *sock, struct signal_info *sig_info)
21682168

21692169
establish_socks_proxy_udpassoc(sock->socks_proxy,
21702170
sock->ctrl_sd,
2171-
sock->sd,
21722171
&sock->socks_relay.dest,
21732172
sock->server_poll_timeout,
21742173
sig_info);
@@ -3481,7 +3480,7 @@ link_socket_write_tcp(struct link_socket *sock,
34813480
#ifdef _WIN32
34823481
return link_socket_write_win32(sock, buf, to);
34833482
#else
3484-
return link_socket_write_tcp_posix(sock, buf, to);
3483+
return link_socket_write_tcp_posix(sock, buf);
34853484
#endif
34863485
}
34873486

src/openvpn/socket.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,8 +1172,7 @@ link_socket_write_udp_posix(struct link_socket *sock,
11721172

11731173
static inline ssize_t
11741174
link_socket_write_tcp_posix(struct link_socket *sock,
1175-
struct buffer *buf,
1176-
struct link_socket_actual *to)
1175+
struct buffer *buf)
11771176
{
11781177
return send(sock->sd, BPTR(buf), BLEN(buf), MSG_NOSIGNAL);
11791178
}

0 commit comments

Comments
 (0)