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
9820c51f
Commit
9820c51f
authored
Mar 07, 2022
by
Michael Tremer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
address: Initialize all bits of IP addresses
Signed-off-by:
Michael Tremer
<
michael.tremer@ipfire.org
>
parent
0a0a289a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
src/libloc/address.h
src/libloc/address.h
+14
-14
No files found.
src/libloc/address.h
View file @
9820c51f
...
@@ -137,17 +137,17 @@ static inline unsigned int loc_address_bit_length(const struct in6_addr* address
...
@@ -137,17 +137,17 @@ static inline unsigned int loc_address_bit_length(const struct in6_addr* address
static
inline
int
loc_address_reset
(
struct
in6_addr
*
address
,
int
family
)
{
static
inline
int
loc_address_reset
(
struct
in6_addr
*
address
,
int
family
)
{
switch
(
family
)
{
switch
(
family
)
{
case
AF_INET6
:
case
AF_INET6
:
address
->
s6_addr32
[
0
]
=
0x0000
;
address
->
s6_addr32
[
0
]
=
0x0000
0000
;
address
->
s6_addr32
[
1
]
=
0x0000
;
address
->
s6_addr32
[
1
]
=
0x0000
0000
;
address
->
s6_addr32
[
2
]
=
0x0000
;
address
->
s6_addr32
[
2
]
=
0x0000
0000
;
address
->
s6_addr32
[
3
]
=
0x0000
;
address
->
s6_addr32
[
3
]
=
0x0000
0000
;
return
0
;
return
0
;
case
AF_INET
:
case
AF_INET
:
address
->
s6_addr32
[
0
]
=
0x0000
;
address
->
s6_addr32
[
0
]
=
0x0000
0000
;
address
->
s6_addr32
[
1
]
=
0x0000
;
address
->
s6_addr32
[
1
]
=
0x0000
0000
;
address
->
s6_addr32
[
2
]
=
htonl
(
0xffff
);
address
->
s6_addr32
[
2
]
=
htonl
(
0xffff
);
address
->
s6_addr32
[
3
]
=
0x0000
;
address
->
s6_addr32
[
3
]
=
0x0000
0000
;
return
0
;
return
0
;
}
}
...
@@ -157,17 +157,17 @@ static inline int loc_address_reset(struct in6_addr* address, int family) {
...
@@ -157,17 +157,17 @@ static inline int loc_address_reset(struct in6_addr* address, int family) {
static
inline
int
loc_address_reset_last
(
struct
in6_addr
*
address
,
int
family
)
{
static
inline
int
loc_address_reset_last
(
struct
in6_addr
*
address
,
int
family
)
{
switch
(
family
)
{
switch
(
family
)
{
case
AF_INET6
:
case
AF_INET6
:
address
->
s6_addr32
[
0
]
=
0xffff
;
address
->
s6_addr32
[
0
]
=
0xffff
ffff
;
address
->
s6_addr32
[
1
]
=
0xffff
;
address
->
s6_addr32
[
1
]
=
0xffff
ffff
;
address
->
s6_addr32
[
2
]
=
0xffff
;
address
->
s6_addr32
[
2
]
=
0xffff
ffff
;
address
->
s6_addr32
[
3
]
=
0xffff
;
address
->
s6_addr32
[
3
]
=
0xffff
ffff
;
return
0
;
return
0
;
case
AF_INET
:
case
AF_INET
:
address
->
s6_addr32
[
0
]
=
0x0000
;
address
->
s6_addr32
[
0
]
=
0x0000
0000
;
address
->
s6_addr32
[
1
]
=
0x0000
;
address
->
s6_addr32
[
1
]
=
0x0000
0000
;
address
->
s6_addr32
[
2
]
=
htonl
(
0xffff
);
address
->
s6_addr32
[
2
]
=
htonl
(
0xffff
);
address
->
s6_addr32
[
3
]
=
0xffff
;
address
->
s6_addr32
[
3
]
=
0xffff
ffff
;
return
0
;
return
0
;
}
}
...
...
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