aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/networking_sitnl.c
diff options
context:
space:
mode:
authorAntonio Quartulli2019-08-05 11:25:25 +0200
committerGert Doering2019-08-07 12:06:09 +0200
commit4490b5a1eae96904f8973d44ff0e12d819cb9cbc (patch)
tree26b557be22719d0faeb0c1f3fd58aeba7f47f411 /src/openvpn/networking_sitnl.c
parentabf7a2f226a262860f369e0a3c5d0f6124b7f110 (diff)
downloadopenvpn-4490b5a1eae96904f8973d44ff0e12d819cb9cbc.zip
openvpn-4490b5a1eae96904f8973d44ff0e12d819cb9cbc.tar.gz
networking/best_gw: remove useless prefixlen parameter
The prefixlen parameter is not used at all while retrieving a route therefore it can safely be removed. Signed-off-by: Antonio Quartulli <antonio2openvpn.net> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20190805092529.9467-3-a@unstable.cc> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18725.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/networking_sitnl.c')
-rw-r--r--src/openvpn/networking_sitnl.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/openvpn/networking_sitnl.c b/src/openvpn/networking_sitnl.c
index 4e29d8b..05cc0ac 100644
--- a/src/openvpn/networking_sitnl.c
+++ b/src/openvpn/networking_sitnl.c
@@ -451,7 +451,7 @@ sitnl_route_save(struct nlmsghdr *n, void *arg)
static int
sitnl_route_best_gw(sa_family_t af_family, const inet_address_t *dst,
- int prefixlen, void *best_gw, char *best_iface)
+ void *best_gw, char *best_iface)
{
struct sitnl_route_req req;
route_res_t res;
@@ -468,7 +468,6 @@ sitnl_route_best_gw(sa_family_t af_family, const inet_address_t *dst,
req.n.nlmsg_flags = NLM_F_REQUEST;
req.r.rtm_family = af_family;
- req.r.rtm_dst_len = prefixlen;
switch (af_family)
{
@@ -503,7 +502,7 @@ err:
/* used by iproute2 implementation too */
int
net_route_v6_best_gw(openvpn_net_ctx_t *ctx, const struct in6_addr *dst,
- int prefixlen, struct in6_addr *best_gw, char *best_iface)
+ struct in6_addr *best_gw, char *best_iface)
{
inet_address_t dst_v6 = {0};
char buf[INET6_ADDRSTRLEN];
@@ -514,11 +513,10 @@ net_route_v6_best_gw(openvpn_net_ctx_t *ctx, const struct in6_addr *dst,
dst_v6.ipv6 = *dst;
}
- msg(D_ROUTE, "%s query: dst %s/%d", __func__,
- inet_ntop(AF_INET6, &dst_v6.ipv6, buf, sizeof(buf)), prefixlen);
+ msg(D_ROUTE, "%s query: dst %s", __func__,
+ inet_ntop(AF_INET6, &dst_v6.ipv6, buf, sizeof(buf)));
- ret = sitnl_route_best_gw(AF_INET6, &dst_v6, prefixlen, best_gw,
- best_iface);
+ ret = sitnl_route_best_gw(AF_INET6, &dst_v6, best_gw, best_iface);
if (ret < 0)
{
return ret;
@@ -544,7 +542,7 @@ net_ctx_init(struct context *c, openvpn_net_ctx_t *ctx)
int
net_route_v4_best_gw(openvpn_net_ctx_t *ctx, const in_addr_t *dst,
- int prefixlen, in_addr_t *best_gw, char *best_iface)
+ in_addr_t *best_gw, char *best_iface)
{
inet_address_t dst_v4 = {0};
char buf[INET_ADDRSTRLEN];
@@ -555,10 +553,10 @@ net_route_v4_best_gw(openvpn_net_ctx_t *ctx, const in_addr_t *dst,
dst_v4.ipv4 = htonl(*dst);
}
- msg(D_ROUTE, "%s query: dst %s/%d", __func__,
- inet_ntop(AF_INET, &dst_v4.ipv4, buf, sizeof(buf)), prefixlen);
+ msg(D_ROUTE, "%s query: dst %s", __func__,
+ inet_ntop(AF_INET, &dst_v4.ipv4, buf, sizeof(buf)));
- ret = sitnl_route_best_gw(AF_INET, &dst_v4, prefixlen, best_gw, best_iface);
+ ret = sitnl_route_best_gw(AF_INET, &dst_v4, best_gw, best_iface);
if (ret < 0)
{
return ret;