Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
a6c395c1
Commit
a6c395c1
authored
22 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
Duncan Wilcox reported a crash with --interface on FreeBSD when ipv6-enabled
and this has been verified to correct the problem.
parent
543e0b1e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/connect.c
+14
-4
14 additions, 4 deletions
lib/connect.c
with
14 additions
and
4 deletions
lib/connect.c
+
14
−
4
View file @
a6c395c1
...
@@ -251,14 +251,23 @@ static CURLcode bindlocal(struct connectdata *conn,
...
@@ -251,14 +251,23 @@ static CURLcode bindlocal(struct connectdata *conn,
Curl_resolv_unlock
(
h
);
Curl_resolv_unlock
(
h
);
/* we don't need it anymore after this function has returned */
/* we don't need it anymore after this function has returned */
memset
((
char
*
)
&
sa
,
0
,
sizeof
(
sa
));
#ifdef ENABLE_IPV6
#ifdef ENABLE_IPV6
memcpy
((
char
*
)
&
sa
.
sin_addr
,
addr
->
ai_addr
,
addr
->
ai_addrlen
);
(
void
)
sa
;
/* prevent compiler warning */
sa
.
sin_family
=
addr
->
ai_family
;
if
(
bind
(
sockfd
,
addr
->
ai_addr
,
addr
->
ai_addrlen
)
>=
0
)
{
/* we succeeded to bind */
struct
sockaddr_in6
add
;
size
=
sizeof
(
add
);
if
(
getsockname
(
sockfd
,
(
struct
sockaddr
*
)
&
add
,
(
socklen_t
*
)
&
size
)
<
0
)
{
failf
(
data
,
"getsockname() failed"
);
return
CURLE_HTTP_PORT_FAILED
;
}
}
#else
#else
memset
((
char
*
)
&
sa
,
0
,
sizeof
(
sa
));
memcpy
((
char
*
)
&
sa
.
sin_addr
,
addr
->
h_addr
,
addr
->
h_length
);
memcpy
((
char
*
)
&
sa
.
sin_addr
,
addr
->
h_addr
,
addr
->
h_length
);
sa
.
sin_family
=
AF_INET
;
sa
.
sin_family
=
AF_INET
;
#endif
sa
.
sin_addr
.
s_addr
=
in
;
sa
.
sin_addr
.
s_addr
=
in
;
sa
.
sin_port
=
0
;
/* get any port */
sa
.
sin_port
=
0
;
/* get any port */
...
@@ -273,6 +282,7 @@ static CURLcode bindlocal(struct connectdata *conn,
...
@@ -273,6 +282,7 @@ static CURLcode bindlocal(struct connectdata *conn,
return
CURLE_HTTP_PORT_FAILED
;
return
CURLE_HTTP_PORT_FAILED
;
}
}
}
}
#endif
else
{
else
{
switch
(
errno
)
{
switch
(
errno
)
{
case
EBADF
:
case
EBADF
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment