Skip to content

Commit 47ec9ef

Browse files
flichtenheldcron2
authored andcommitted
route: Remove unused function print_routes
This function has never been used in the git history. Probably an OpenVPN 1.x remnant. Identified by cppcheck. Change-Id: Idfa78643da27fe8a8bd0ff2bcf3025d8687024a9 Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Gert Doering <gert@greenie.muc.de> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1865 Message-Id: <20260824161431.1639-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg38636.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
1 parent 32d04eb commit 47ec9ef

2 files changed

Lines changed: 0 additions & 36 deletions

File tree

src/openvpn/route.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,6 @@ copy_route_ipv6_option_list(struct route_ipv6_option_list *dest,
185185
dest->gc = a;
186186
}
187187

188-
static const char *
189-
route_string(const struct route_ipv4 *r, struct gc_arena *gc)
190-
{
191-
struct buffer out = alloc_buf_gc(256, gc);
192-
buf_printf(&out, "ROUTE network %s netmask %s gateway %s", print_in_addr_t(r->network, 0, gc),
193-
print_in_addr_t(r->netmask, 0, gc), print_in_addr_t(r->gateway, 0, gc));
194-
if (r->flags & RT_METRIC_DEFINED)
195-
{
196-
buf_printf(&out, " metric %d", r->metric);
197-
}
198-
return BSTR(&out);
199-
}
200-
201188
static bool
202189
is_route_parm_defined(const char *parm)
203190
{
@@ -1324,27 +1311,6 @@ print_default_gateway(const msglvl_t msglevel, const struct route_gateway_info *
13241311

13251312
#endif /* ifndef ENABLE_SMALL */
13261313

1327-
static void
1328-
print_route(const struct route_ipv4 *r, msglvl_t msglevel)
1329-
{
1330-
struct gc_arena gc = gc_new();
1331-
if (r->flags & RT_DEFINED)
1332-
{
1333-
msg(msglevel, "%s", route_string(r, &gc));
1334-
}
1335-
gc_free(&gc);
1336-
}
1337-
1338-
void
1339-
print_routes(const struct route_list *rl, msglvl_t msglevel)
1340-
{
1341-
struct route_ipv4 *r;
1342-
for (r = rl->routes; r; r = r->next)
1343-
{
1344-
print_route(r, msglevel);
1345-
}
1346-
}
1347-
13481314
static void
13491315
setenv_route(struct env_set *es, const struct route_ipv4 *r, int i)
13501316
{

src/openvpn/route.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,6 @@ void print_route_options(const struct route_option_list *rol, msglvl_t msglevel)
377377

378378
#endif
379379

380-
void print_routes(const struct route_list *rl, msglvl_t msglevel);
381-
382380
#ifdef _WIN32
383381

384382
void show_routes(msglvl_t msglevel);

0 commit comments

Comments
 (0)