aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/routingtable.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-09 02:48:33 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-09 04:40:22 +0200
commit0911027c09cf3f734f39f0d3b1bfe4119b73b100 (patch)
tree5fc1a46bb0341db5a15bfa87a74f77e32a2e58a1 /src/routingtable.h
parentcrypto/x86_64: satisfy stack validation 2.0 (diff)
downloadwireguard-monolithic-historical-0911027c09cf3f734f39f0d3b1bfe4119b73b100.tar.xz
wireguard-monolithic-historical-0911027c09cf3f734f39f0d3b1bfe4119b73b100.zip
routingtable: only use device's mutex, not a special rt one
Diffstat (limited to 'src/routingtable.h')
-rw-r--r--src/routingtable.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/routingtable.h b/src/routingtable.h
index c251354..815118c 100644
--- a/src/routingtable.h
+++ b/src/routingtable.h
@@ -13,17 +13,15 @@ struct routing_table_node;
struct routing_table {
struct routing_table_node __rcu *root4;
struct routing_table_node __rcu *root6;
- struct mutex table_update_lock;
};
void routing_table_init(struct routing_table *table);
-void routing_table_free(struct routing_table *table);
-int routing_table_insert_v4(struct routing_table *table, const struct in_addr *ip, u8 cidr, struct wireguard_peer *peer);
-int routing_table_insert_v6(struct routing_table *table, const struct in6_addr *ip, u8 cidr, struct wireguard_peer *peer);
-void routing_table_remove_by_peer(struct routing_table *table, struct wireguard_peer *peer);
-size_t routing_table_count_nodes(struct routing_table *table);
-int routing_table_walk_ips_by_peer(struct routing_table *table, void *ctx, struct wireguard_peer *peer, int (*func)(void *ctx, union nf_inet_addr ip, u8 cidr, int family));
-int routing_table_walk_ips_by_peer_sleepable(struct routing_table *table, void *ctx, struct wireguard_peer *peer, int (*func)(void *ctx, union nf_inet_addr ip, u8 cidr, int family));
+void routing_table_free(struct routing_table *table, struct mutex *mutex);
+int routing_table_insert_v4(struct routing_table *table, const struct in_addr *ip, u8 cidr, struct wireguard_peer *peer, struct mutex *mutex);
+int routing_table_insert_v6(struct routing_table *table, const struct in6_addr *ip, u8 cidr, struct wireguard_peer *peer, struct mutex *mutex);
+void routing_table_remove_by_peer(struct routing_table *table, struct wireguard_peer *peer, struct mutex *mutex);
+
+int routing_table_walk_ips_by_peer(struct routing_table *table, void *ctx, struct wireguard_peer *peer, int (*func)(void *ctx, union nf_inet_addr ip, u8 cidr, int family), struct mutex *mutex);
/* These return a strong reference to a peer: */
struct wireguard_peer *routing_table_lookup_dst(struct routing_table *table, struct sk_buff *skb);