summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
Diffstat (limited to 'networking')
-rw-r--r--networking/libiproute/libnetlink.h5
-rw-r--r--networking/ping6.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/networking/libiproute/libnetlink.h b/networking/libiproute/libnetlink.h
index 6dd242d..9a5a9d3 100644
--- a/networking/libiproute/libnetlink.h
+++ b/networking/libiproute/libnetlink.h
@@ -2,6 +2,9 @@
#ifndef __LIBNETLINK_H__
#define __LIBNETLINK_H__ 1
+#include <linux/types.h>
+/* We need linux/types.h because older kernels use __u32 etc
+ * in linux/[rt]netlink.h. 2.6.19 seems to be ok, though */
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
@@ -37,6 +40,4 @@ extern int rta_addattr_l(struct rtattr *rta, int maxlen, int type, void *data, i
extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len);
-
#endif /* __LIBNETLINK_H__ */
-
diff --git a/networking/ping6.c b/networking/ping6.c
index b95e098..c691fa7 100644
--- a/networking/ping6.c
+++ b/networking/ping6.c
@@ -42,6 +42,8 @@ enum {
PINGINTERVAL = 1 /* second */
};
+static const char *hostname;
+
static void ping(const char *host);
#ifndef CONFIG_FEATURE_FANCY_PING6
@@ -50,7 +52,7 @@ static void ping(const char *host);
static void noresp(int ign)
{
- printf("No response from %s\n", h->h_name);
+ printf("No response from %s\n", hostname);
exit(EXIT_FAILURE);
}
@@ -63,6 +65,8 @@ static void ping(const char *host)
int sockopt;
char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN];
+ hostname = host;
+
pingsock = create_icmp6_socket();
lsa = host_and_af2sockaddr(host, 0, AF_INET6);
@@ -105,7 +109,7 @@ static void ping(const char *host)
}
if (ENABLE_FEATURE_CLEAN_UP)
close(pingsock);
- printf("%s is alive!\n", h->h_name);
+ printf("%s is alive!\n", hostname);
}
int ping6_main(int argc, char **argv)