From 72ca317510410c91c96b2cda682cdcd893c8835c Mon Sep 17 00:00:00 2001 From: Radkesvat <134321679+radkesvat@users.noreply.github.com> Date: Thu, 8 Aug 2024 19:31:33 +0000 Subject: [PATCH] changes to fix win32 build, comments --- tunnels/layer3/ip_routing_table/ip_routing_table.c | 2 +- tunnels/layer3/ip_routing_table/ip_routing_table.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tunnels/layer3/ip_routing_table/ip_routing_table.c b/tunnels/layer3/ip_routing_table/ip_routing_table.c index b8491f5..6bba0dd 100644 --- a/tunnels/layer3/ip_routing_table/ip_routing_table.c +++ b/tunnels/layer3/ip_routing_table/ip_routing_table.c @@ -51,7 +51,7 @@ static void upStreamSrcMode(tunnel_t *self, context_t *c) { for (unsigned int i = 0; i < state->routes_len; i++) { - if (state->routes[i].v4 && checkIPRange4((struct in_addr) {packet->ip4_header.saddr}, + if (state->routes[i].v4 && checkIPRange4(*(struct in_addr*) (&packet->ip4_header.saddr), state->routes[i].ip.ip4, state->routes[i].mask.mask4)) { state->routes[i].next->upStream(state->routes[i].next, c); diff --git a/tunnels/layer3/ip_routing_table/ip_routing_table.h b/tunnels/layer3/ip_routing_table/ip_routing_table.h index 6b2f1a7..9d163a0 100644 --- a/tunnels/layer3/ip_routing_table/ip_routing_table.h +++ b/tunnels/layer3/ip_routing_table/ip_routing_table.h @@ -1,7 +1,8 @@ #pragma once #include "api.h" - -// Layer3Packet <------> if(ip == rule) <------> Layer3Packet +// ------> Layer3Packet Route A +// Layer3Packet ------> if(ip == rule.ip) +// ------> Layer3Packet Route B tunnel_t * newLayer3IpRoutingTable(node_instance_context_t *instance_info); api_result_t apiLayer3IpRoutingTable(tunnel_t *self, const char *msg);