|
|
@ -2277,18 +2277,7 @@ static int routectl(int cmd, int flags, n2n_route_t *route, int if_idx) { |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
/* Add the user-provided routes to the linux routing table. Network routes
|
|
|
|
* are bound to the n2n TAP device, so they are automatically removed when |
|
|
|
* the TAP device is destroyed. */ |
|
|
|
static int edge_init_routes(n2n_edge_t *eee, n2n_route_t *routes, uint16_t num_routes) { |
|
|
|
#ifdef __linux__ |
|
|
|
return edge_init_routes_linux(eee, routes, num_routes); |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef WIN32 |
|
|
|
return edge_init_routes_win(eee, routes, num_routes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
/* ************************************** */ |
|
|
|
|
|
|
|
static int edge_init_routes_linux(n2n_edge_t *eee, n2n_route_t *routes, uint16_t num_routes) { |
|
|
|
#ifdef __linux__ |
|
|
@ -2380,6 +2369,8 @@ static int edge_init_routes_linux(n2n_edge_t *eee, n2n_route_t *routes, uint16_t |
|
|
|
return(0); |
|
|
|
} |
|
|
|
|
|
|
|
/* ************************************** */ |
|
|
|
|
|
|
|
static int edge_init_routes_win(n2n_edge_t *eee, n2n_route_t *routes, uint16_t num_routes) |
|
|
|
{ |
|
|
|
#ifdef WIN32 |
|
|
@ -2417,6 +2408,21 @@ static int edge_init_routes_win(n2n_edge_t *eee, n2n_route_t *routes, uint16_t n |
|
|
|
|
|
|
|
/* ************************************** */ |
|
|
|
|
|
|
|
/* Add the user-provided routes to the linux routing table. Network routes
|
|
|
|
* are bound to the n2n TAP device, so they are automatically removed when |
|
|
|
* the TAP device is destroyed. */ |
|
|
|
static int edge_init_routes(n2n_edge_t *eee, n2n_route_t *routes, uint16_t num_routes) { |
|
|
|
#ifdef __linux__ |
|
|
|
return edge_init_routes_linux(eee, routes, num_routes); |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef WIN32 |
|
|
|
return edge_init_routes_win(eee, routes, num_routes); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
/* ************************************** */ |
|
|
|
|
|
|
|
static void edge_cleanup_routes(n2n_edge_t *eee) { |
|
|
|
#ifdef __linux__ |
|
|
|
if(eee->sn_route_to_clean) { |
|
|
|