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
d086fdaf
Commit
d086fdaf
authored
16 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
add missing header inclusions
parent
8693afdf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/if2ip.c
+19
-8
19 additions, 8 deletions
lib/if2ip.c
with
19 additions
and
8 deletions
lib/if2ip.c
+
19
−
8
View file @
d086fdaf
...
...
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 200
7
, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 200
8
, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
...
...
@@ -64,6 +64,13 @@
#include
"inet_ntop.h"
#include
"strequal.h"
#define _MPRINTF_REPLACE
/* use our functions only */
#include
<curl/mprintf.h>
#include
"memory.h"
/* The last #include file should be: */
#include
"memdebug.h"
char
*
Curl_if2ip
(
int
af
,
const
char
*
interface
,
char
*
buf
,
int
buf_size
)
{
struct
ifaddrs
*
iface
,
*
head
;
...
...
@@ -74,19 +81,20 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size)
if
((
iface
->
ifa_addr
->
sa_family
==
af
)
&&
curl_strequal
(
iface
->
ifa_name
,
interface
))
{
void
*
addr
;
char
scope
[
12
]
=
""
;
char
scope
[
12
]
=
""
;
if
(
af
==
AF_INET6
)
{
unsigned
int
scopeid
;
addr
=
&
((
struct
sockaddr_in6
*
)
iface
->
ifa_addr
)
->
sin6_addr
;
/* Include the scope of this interface as part of the address */
/* Include the scope of this interface as part of the address */
scopeid
=
((
struct
sockaddr_in6
*
)
iface
->
ifa_addr
)
->
sin6_scope_id
;
if
(
scopeid
)
snprintf
(
scope
,
sizeof
(
scope
),
"%%%u"
,
scopeid
);
}
else
snprintf
(
scope
,
sizeof
(
scope
),
"%%%u"
,
scopeid
);
}
else
addr
=
&
((
struct
sockaddr_in
*
)
iface
->
ifa_addr
)
->
sin_addr
;
ip
=
(
char
*
)
Curl_inet_ntop
(
af
,
addr
,
buf
,
buf_size
);
strlcat
(
buf
,
scope
,
buf_size
);
break
;
strlcat
(
buf
,
scope
,
buf_size
);
break
;
}
}
freeifaddrs
(
head
);
...
...
@@ -130,8 +138,11 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size)
#endif
#include
"inet_ntop.h"
#include
"memory.h"
#define _MPRINTF_REPLACE
/* use our functions only */
#include
<curl/mprintf.h>
#include
"memory.h"
/* The last #include file should be: */
#include
"memdebug.h"
...
...
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