Skip to content

Commit

Permalink
networking: remove duplicate methods from networking_sitnl.c
Browse files Browse the repository at this point in the history
The net_ctx_init/reset/free methods of sitnl are the same dummy
methods that are already defined for non-Linux platforms in the
networking.h header.

Signed-off-by: Arne Schwabe <[email protected]>
Signed-off-by: Antonio Quartulli <[email protected]>
Acked-by: Gert Doering <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg24054.html
Signed-off-by: Gert Doering <[email protected]>
  • Loading branch information
schwabe authored and cron2 committed Apr 3, 2022
1 parent 711a404 commit c0fa37e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
7 changes: 6 additions & 1 deletion src/openvpn/networking.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ struct context;
/* define mock types to ensure code builds on any platform */
typedef void *openvpn_net_ctx_t;
typedef void *openvpn_net_iface_t;
#endif /* ifdef ENABLE_SITNL */

/* Only the iproute2 backend implements these functions,
* the rest can rely on these stubs
*/
#if !defined(ENABLE_IPROUTE)
static inline int
net_ctx_init(struct context *c, openvpn_net_ctx_t *ctx)
{
Expand All @@ -51,7 +56,7 @@ net_ctx_free(openvpn_net_ctx_t *ctx)
{
(void)ctx;
}
#endif /* ifdef ENABLE_SITNL */
#endif /* !defined(ENABLE_IPROUTE) */

#if defined(ENABLE_SITNL) || defined(ENABLE_IPROUTE)

Expand Down
22 changes: 0 additions & 22 deletions src/openvpn/networking_sitnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,28 +596,6 @@ net_route_v6_best_gw(openvpn_net_ctx_t *ctx, const struct in6_addr *dst,
}

#ifdef ENABLE_SITNL

int
net_ctx_init(struct context *c, openvpn_net_ctx_t *ctx)
{
(void)c;
(void)ctx;

return 0;
}

void
net_ctx_reset(openvpn_net_ctx_t *ctx)
{
(void)ctx;
}

void
net_ctx_free(openvpn_net_ctx_t *ctx)
{
(void)ctx;
}

int
net_route_v4_best_gw(openvpn_net_ctx_t *ctx, const in_addr_t *dst,
in_addr_t *best_gw, char *best_iface)
Expand Down

0 comments on commit c0fa37e

Please sign in to comment.