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
6f060cae
Commit
6f060cae
authored
Mar 07, 2022
by
Michael Tremer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address: Correctly subtract IPv4 addresses
Signed-off-by:
Michael Tremer
<
michael.tremer@ipfire.org
>
parent
88a3db10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/libloc/private.h
src/libloc/private.h
+1
-1
No files found.
src/libloc/private.h
View file @
6f060cae
...
@@ -212,7 +212,7 @@ static inline int __loc_address4_sub(struct in6_addr* result,
...
@@ -212,7 +212,7 @@ static inline int __loc_address4_sub(struct in6_addr* result,
const
struct
in6_addr
*
address1
,
const
struct
in6_addr
*
address2
)
{
const
struct
in6_addr
*
address1
,
const
struct
in6_addr
*
address2
)
{
int
remainder
=
0
;
int
remainder
=
0
;
for
(
int
octet
=
4
;
octet
>=
0
;
octet
--
)
{
for
(
int
octet
=
15
;
octet
>=
12
;
octet
--
)
{
int
x
=
address1
->
s6_addr
[
octet
]
-
address2
->
s6_addr
[
octet
]
+
remainder
;
int
x
=
address1
->
s6_addr
[
octet
]
-
address2
->
s6_addr
[
octet
]
+
remainder
;
// Store remainder for the next iteration
// Store remainder for the next iteration
...
...
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