kernel-netlink: Implement passthrough type routes and use them on Linux

Enables us to ignore any future kernel features for routes unless
we actually need to consider them for the source IP routes.

Also enables us to actually really skip IPsec processing for those networks
(because even the routes don't touch those packets). It's more what
users expect.

Co-authored-by: Tobias Brunner <[email protected]>
This commit is contained in:
Noel Kuntze
2020-03-10 10:20:58 +01:00
committed by Tobias Brunner
co-authored by Tobias Brunner
parent 4958acc0c2
commit 09f4bccfea
11 changed files with 124 additions and 80 deletions
+4 -2
View File
@@ -375,12 +375,13 @@ struct kernel_interface_t {
* @param gateway gateway for this route
* @param src_ip source ip of the route
* @param if_name name of the interface the route is bound to
* @param pass TRUE if route is installed for passthrough policy
* @return SUCCESS if operation completed
* ALREADY_DONE if the route already exists
*/
status_t (*add_route) (kernel_interface_t *this, chunk_t dst_net,
uint8_t prefixlen, host_t *gateway, host_t *src_ip,
char *if_name);
char *if_name, bool pass);
/**
* Delete a route.
@@ -390,11 +391,12 @@ struct kernel_interface_t {
* @param gateway gateway for this route
* @param src_ip source ip of the route
* @param if_name name of the interface the route is bound to
* @param pass TRUE if route was installed for passthrough policy
* @return SUCCESS if operation completed
*/
status_t (*del_route) (kernel_interface_t *this, chunk_t dst_net,
uint8_t prefixlen, host_t *gateway, host_t *src_ip,
char *if_name);
char *if_name, bool pass);
/**
* Set up a bypass policy for a given socket.