diff options
Diffstat (limited to 'networking')
-rw-r--r-- | networking/libiproute/libnetlink.h | 5 | ||||
-rw-r--r-- | networking/ping6.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/networking/libiproute/libnetlink.h b/networking/libiproute/libnetlink.h index 6dd242d03..9a5a9d351 100644 --- a/networking/libiproute/libnetlink.h +++ b/networking/libiproute/libnetlink.h | |||
@@ -2,6 +2,9 @@ | |||
2 | #ifndef __LIBNETLINK_H__ | 2 | #ifndef __LIBNETLINK_H__ |
3 | #define __LIBNETLINK_H__ 1 | 3 | #define __LIBNETLINK_H__ 1 |
4 | 4 | ||
5 | #include <linux/types.h> | ||
6 | /* We need linux/types.h because older kernels use __u32 etc | ||
7 | * in linux/[rt]netlink.h. 2.6.19 seems to be ok, though */ | ||
5 | #include <linux/netlink.h> | 8 | #include <linux/netlink.h> |
6 | #include <linux/rtnetlink.h> | 9 | #include <linux/rtnetlink.h> |
7 | 10 | ||
@@ -37,6 +40,4 @@ extern int rta_addattr_l(struct rtattr *rta, int maxlen, int type, void *data, i | |||
37 | 40 | ||
38 | extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len); | 41 | extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len); |
39 | 42 | ||
40 | |||
41 | #endif /* __LIBNETLINK_H__ */ | 43 | #endif /* __LIBNETLINK_H__ */ |
42 | |||
diff --git a/networking/ping6.c b/networking/ping6.c index b95e098ad..c691fa74b 100644 --- a/networking/ping6.c +++ b/networking/ping6.c | |||
@@ -42,6 +42,8 @@ enum { | |||
42 | PINGINTERVAL = 1 /* second */ | 42 | PINGINTERVAL = 1 /* second */ |
43 | }; | 43 | }; |
44 | 44 | ||
45 | static const char *hostname; | ||
46 | |||
45 | static void ping(const char *host); | 47 | static void ping(const char *host); |
46 | 48 | ||
47 | #ifndef CONFIG_FEATURE_FANCY_PING6 | 49 | #ifndef CONFIG_FEATURE_FANCY_PING6 |
@@ -50,7 +52,7 @@ static void ping(const char *host); | |||
50 | 52 | ||
51 | static void noresp(int ign) | 53 | static void noresp(int ign) |
52 | { | 54 | { |
53 | printf("No response from %s\n", h->h_name); | 55 | printf("No response from %s\n", hostname); |
54 | exit(EXIT_FAILURE); | 56 | exit(EXIT_FAILURE); |
55 | } | 57 | } |
56 | 58 | ||
@@ -63,6 +65,8 @@ static void ping(const char *host) | |||
63 | int sockopt; | 65 | int sockopt; |
64 | char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN]; | 66 | char packet[DEFDATALEN + MAXIPLEN + MAXICMPLEN]; |
65 | 67 | ||
68 | hostname = host; | ||
69 | |||
66 | pingsock = create_icmp6_socket(); | 70 | pingsock = create_icmp6_socket(); |
67 | 71 | ||
68 | lsa = host_and_af2sockaddr(host, 0, AF_INET6); | 72 | lsa = host_and_af2sockaddr(host, 0, AF_INET6); |
@@ -105,7 +109,7 @@ static void ping(const char *host) | |||
105 | } | 109 | } |
106 | if (ENABLE_FEATURE_CLEAN_UP) | 110 | if (ENABLE_FEATURE_CLEAN_UP) |
107 | close(pingsock); | 111 | close(pingsock); |
108 | printf("%s is alive!\n", h->h_name); | 112 | printf("%s is alive!\n", hostname); |
109 | } | 113 | } |
110 | 114 | ||
111 | int ping6_main(int argc, char **argv) | 115 | int ping6_main(int argc, char **argv) |