Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
ram: Use POSIX types
[slstatus.git]
/
components
/
ip.c
diff --git
a/components/ip.c
b/components/ip.c
index
468dc84
..
a7b1bfd
100644
(file)
--- a/
components/ip.c
+++ b/
components/ip.c
@@
-1,5
+1,4
@@
/* See LICENSE file for copyright and license details. */
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <stdio.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <stdio.h>
@@
-12,7
+11,7
@@
#include "../util.h"
static const char *
#include "../util.h"
static const char *
-ip(const char *iface, unsigned short sa_family)
+ip(const char *i
nter
face, unsigned short sa_family)
{
struct ifaddrs *ifaddr, *ifa;
int s;
{
struct ifaddrs *ifaddr, *ifa;
int s;
@@
-29,7
+28,7
@@
ip(const char *iface, unsigned short sa_family)
}
s = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in6),
host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
}
s = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in6),
host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
- if (!strcmp(ifa->ifa_name, iface) &&
+ if (!strcmp(ifa->ifa_name, i
nter
face) &&
(ifa->ifa_addr->sa_family == sa_family)) {
freeifaddrs(ifaddr);
if (s != 0) {
(ifa->ifa_addr->sa_family == sa_family)) {
freeifaddrs(ifaddr);
if (s != 0) {
@@
-46,13
+45,13
@@
ip(const char *iface, unsigned short sa_family)
}
const char *
}
const char *
-ipv4(const char *iface)
+ipv4(const char *i
nter
face)
{
{
- return ip(iface, AF_INET);
+ return ip(i
nter
face, AF_INET);
}
const char *
}
const char *
-ipv6(const char *iface)
+ipv6(const char *i
nter
face)
{
{
- return ip(iface, AF_INET6);
+ return ip(i
nter
face, AF_INET6);
}
}