]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
database: Make level variable unsigned (as used in log messages)
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Jan 2018 18:36:49 +0000 (18:36 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Jan 2018 18:36:49 +0000 (18:36 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
examples/python/read-database.py
src/database.c

index 2f59dec4ecc96d777cf0ee1331ea058da5fa7f82..28a2c6d7b880a98c4217112dc64f4fa00ddb5c81 100644 (file)
@@ -17,3 +17,6 @@ print(a)
 # Search for an IP address in the database
 n = d.lookup("8.8.8.8")
 print(n)
+
+n = d.lookup("2a07:1c44:5800:1234:1234:1234:1234:1234")
+print(n)
index 2d930a68b322cc5b845d7cdafcf5ccba2a9ffbe7..563546a130d93b45dc14c1878d14ecdf4057b6ef 100644 (file)
@@ -453,7 +453,7 @@ static int __loc_database_lookup_handle_leaf(struct loc_database* db, const stru
 // Returns the highest result available
 static int __loc_database_lookup_max(struct loc_database* db, const struct in6_addr* address,
                struct loc_network** network, struct in6_addr* network_address,
-               const struct loc_database_network_node_v0* node, int level) {
+               const struct loc_database_network_node_v0* node, unsigned int level) {
        // If the node is a leaf node, we end here
        if (__loc_database_node_is_leaf(node))
                return __loc_database_lookup_handle_leaf(db, address, network, network_address, node);
@@ -501,7 +501,7 @@ static int __loc_database_lookup_max(struct loc_database* db, const struct in6_a
 // Searches for an exact match along the path
 static int __loc_database_lookup(struct loc_database* db, const struct in6_addr* address,
                struct loc_network** network, struct in6_addr* network_address,
-               const struct loc_database_network_node_v0* node, int level) {
+               const struct loc_database_network_node_v0* node, unsigned int level) {
        // If the node is a leaf node, we end here
        if (__loc_database_node_is_leaf(node))
                return __loc_database_lookup_handle_leaf(db, address, network, network_address, node);