]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
networking: remove duplicate methods from networking_sitnl.c
authorArne Schwabe <arne@rfc2549.org>
Sat, 2 Apr 2022 07:08:56 +0000 (09:08 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 3 Apr 2022 14:42:12 +0000 (16:42 +0200)
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 <arne@rfc2549.org>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220402070902.30282-2-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24054.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/networking.h
src/openvpn/networking_sitnl.c

index 4e7610ec54e19d89b42ca85d589644310b833e0a..2cbf61634b9c8f3556d7a238caee46219099369e 100644 (file)
@@ -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)
 {
@@ -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)
 
index 515a30d6f0c49ca16696628b8b596863ab9e9bc7..9b2f58d998c977c8a381bbf0f53ceee63279f6a9 100644 (file)
@@ -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)