Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
f7550295
Commit
f7550295
authored
Jan 25, 2002
by
Martin Pool
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compare_addrinfo_sockaddr: Add code to compare AF_INET6 addresses.
parent
974f27e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
clientname.c
clientname.c
+13
-16
No files found.
clientname.c
View file @
f7550295
...
...
@@ -185,6 +185,7 @@ int compare_addrinfo_sockaddr(const struct addrinfo *ai,
{
int
ss_family
=
get_sockaddr_family
(
ss
);
const
char
fn
[]
=
"compare_addrinfo_sockaddr"
;
size_t
valid_len
;
if
(
ai
->
ai_family
!=
ss_family
)
{
rprintf
(
FERROR
,
...
...
@@ -193,25 +194,21 @@ int compare_addrinfo_sockaddr(const struct addrinfo *ai,
return
1
;
}
/* The comparison method depends on the particular AF. */
if
(
ss_family
==
AF_INET
)
{
const
struct
sockaddr_in
*
sin1
,
*
sin2
;
sin1
=
(
const
struct
sockaddr_in
*
)
ss
;
sin2
=
(
const
struct
sockaddr_in
*
)
ai
->
ai_addr
;
return
memcmp
(
sin1
,
sin2
,
sizeof
*
sin1
);
}
switch
(
ss_family
)
{
case
AF_INET
:
valid_len
=
sizeof
(
struct
sockaddr_in
);
break
;
#ifdef INET6
else
if
(
ss_family
==
AF_INET6
)
{
/* XXXX */
return
1
;
}
#endif
/* INET6 */
else
{
/* don't know */
case
AF_INET6
:
valid_len
=
sizeof
(
struct
sockaddr_in6
);
break
;
#endif
default:
/* Don't know what to do! */
return
1
;
}
return
memcmp
(
ss
,
ai
->
ai_addr
,
valid_len
);
}
...
...
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