summaryrefslogtreecommitdiffhomepage
path: root/src/trie.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-12-01 23:37:26 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-12-01 23:37:26 +0100
commiteaca1ee1f79422a501394415fd4ae8f227a134af (patch)
tree1fbfad20b2e9a6b68d5ccd928ed6678596de76b9 /src/trie.go
parentcb09125dc4c64360697af700ba71331d91e9edcd (diff)
More consistent use of signal struct
Diffstat (limited to 'src/trie.go')
-rw-r--r--src/trie.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/trie.go b/src/trie.go
index 38fcd4a..405ffc3 100644
--- a/src/trie.go
+++ b/src/trie.go
@@ -11,10 +11,8 @@ import (
* same way as those created by the "net" functions.
* Here the IPs are slices of either 4 or 16 byte (not always 16)
*
- * Syncronization done seperatly
+ * Synchronization done separately
* See: routing.go
- *
- * TODO: Better commenting
*/
type Trie struct {
@@ -30,7 +28,11 @@ type Trie struct {
}
/* Finds length of matching prefix
- * TODO: Make faster
+ *
+ * TODO: Only use during insertion (xor + prefix mask for lookup)
+ * Check out
+ * prefix_matches(struct allowedips_node *node, const u8 *key, u8 bits)
+ * https://git.zx2c4.com/WireGuard/commit/?h=jd/precomputed-prefix-match
*
* Assumption:
* len(ip1) == len(ip2)
@@ -88,7 +90,7 @@ func (node *Trie) RemovePeer(p *Peer) *Trie {
return node
}
- // walk recursivly
+ // walk recursively
node.child[0] = node.child[0].RemovePeer(p)
node.child[1] = node.child[1].RemovePeer(p)