Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libloc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
libloc
Commits
f66f15e1
Commit
f66f15e1
authored
Jan 08, 2018
by
Michael Tremer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
database: Make level variable unsigned (as used in log messages)
Signed-off-by:
Michael Tremer
<
michael.tremer@ipfire.org
>
parent
372af0e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
examples/python/read-database.py
examples/python/read-database.py
+3
-0
src/database.c
src/database.c
+2
-2
No files found.
examples/python/read-database.py
View file @
f66f15e1
...
...
@@ -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
)
src/database.c
View file @
f66f15e1
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment