diff options
Diffstat (limited to 'networking/ifconfig.c')
-rw-r--r-- | networking/ifconfig.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/networking/ifconfig.c b/networking/ifconfig.c index 513f176d1..d0ee4c3a5 100644 --- a/networking/ifconfig.c +++ b/networking/ifconfig.c | |||
@@ -15,7 +15,7 @@ | |||
15 | * Foundation; either version 2 of the License, or (at | 15 | * Foundation; either version 2 of the License, or (at |
16 | * your option) any later version. | 16 | * your option) any later version. |
17 | * | 17 | * |
18 | * $Id: ifconfig.c,v 1.19 2002/08/22 18:22:10 bug1 Exp $ | 18 | * $Id: ifconfig.c,v 1.20 2002/11/26 09:02:05 bug1 Exp $ |
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
@@ -46,7 +46,7 @@ | |||
46 | #include "busybox.h" | 46 | #include "busybox.h" |
47 | 47 | ||
48 | #ifdef CONFIG_FEATURE_IFCONFIG_SLIP | 48 | #ifdef CONFIG_FEATURE_IFCONFIG_SLIP |
49 | #include <linux/if_slip.h> | 49 | # include <linux/if_slip.h> |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | /* I don't know if this is needed for busybox or not. Anyone? */ | 52 | /* I don't know if this is needed for busybox or not. Anyone? */ |
@@ -55,20 +55,20 @@ | |||
55 | 55 | ||
56 | /* Defines for glibc2.0 users. */ | 56 | /* Defines for glibc2.0 users. */ |
57 | #ifndef SIOCSIFTXQLEN | 57 | #ifndef SIOCSIFTXQLEN |
58 | #define SIOCSIFTXQLEN 0x8943 | 58 | # define SIOCSIFTXQLEN 0x8943 |
59 | #define SIOCGIFTXQLEN 0x8942 | 59 | # define SIOCGIFTXQLEN 0x8942 |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | /* ifr_qlen is ifru_ivalue, but it isn't present in 2.0 kernel headers */ | 62 | /* ifr_qlen is ifru_ivalue, but it isn't present in 2.0 kernel headers */ |
63 | #ifndef ifr_qlen | 63 | #ifndef ifr_qlen |
64 | #define ifr_qlen ifr_ifru.ifru_mtu | 64 | # define ifr_qlen ifr_ifru.ifru_mtu |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #ifndef IFF_DYNAMIC | 67 | #ifndef IFF_DYNAMIC |
68 | #define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses */ | 68 | # define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses */ |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | #if CONFIG_FEATURE_IPV6 | 71 | #ifdef CONFIG_FEATURE_IPV6 |
72 | struct in6_ifreq { | 72 | struct in6_ifreq { |
73 | struct in6_addr ifr6_addr; | 73 | struct in6_addr ifr6_addr; |
74 | uint32_t ifr6_prefixlen; | 74 | uint32_t ifr6_prefixlen; |
@@ -199,7 +199,7 @@ static const struct arg1opt Arg1Opt[] = { | |||
199 | {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.irq)}, | 199 | {"SIOCSIFMAP", SIOCSIFMAP, ifreq_offsetof(ifr_map.irq)}, |
200 | #endif | 200 | #endif |
201 | /* Last entry if for unmatched (possibly hostname) arg. */ | 201 | /* Last entry if for unmatched (possibly hostname) arg. */ |
202 | #if CONFIG_FEATURE_IPV6 | 202 | #ifdef CONFIG_FEATURE_IPV6 |
203 | {"SIOCSIFADDR", SIOCSIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */ | 203 | {"SIOCSIFADDR", SIOCSIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */ |
204 | {"SIOCDIFADDR", SIOCDIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */ | 204 | {"SIOCDIFADDR", SIOCDIFADDR, ifreq_offsetof(ifr_addr)}, /* IPv6 version ignores the offset */ |
205 | #endif | 205 | #endif |
@@ -228,7 +228,7 @@ static const struct options OptArray[] = { | |||
228 | {"io_addr", N_ARG, ARG_IO_ADDR, 0}, | 228 | {"io_addr", N_ARG, ARG_IO_ADDR, 0}, |
229 | {"irq", N_ARG, ARG_IRQ, 0}, | 229 | {"irq", N_ARG, ARG_IRQ, 0}, |
230 | #endif | 230 | #endif |
231 | #if CONFIG_FEATURE_IPV6 | 231 | #ifdef CONFIG_FEATURE_IPV6 |
232 | {"add", N_ARG, ARG_ADD_DEL, 0}, | 232 | {"add", N_ARG, ARG_ADD_DEL, 0}, |
233 | {"del", N_ARG, ARG_ADD_DEL, 0}, | 233 | {"del", N_ARG, ARG_ADD_DEL, 0}, |
234 | #endif | 234 | #endif |
@@ -265,7 +265,7 @@ int ifconfig_main(int argc, char **argv) | |||
265 | struct ifreq ifr; | 265 | struct ifreq ifr; |
266 | struct sockaddr_in sai; | 266 | struct sockaddr_in sai; |
267 | 267 | ||
268 | #if CONFIG_FEATURE_IPV6 | 268 | #ifdef CONFIG_FEATURE_IPV6 |
269 | struct sockaddr_in6 sai6; | 269 | struct sockaddr_in6 sai6; |
270 | #endif | 270 | #endif |
271 | #ifdef CONFIG_FEATURE_IFCONFIG_HW | 271 | #ifdef CONFIG_FEATURE_IFCONFIG_HW |
@@ -359,13 +359,13 @@ int ifconfig_main(int argc, char **argv) | |||
359 | #ifdef CONFIG_FEATURE_IFCONFIG_HW | 359 | #ifdef CONFIG_FEATURE_IFCONFIG_HW |
360 | if (mask & A_CAST_RESOLVE) { | 360 | if (mask & A_CAST_RESOLVE) { |
361 | #endif | 361 | #endif |
362 | #if CONFIG_FEATURE_IPV6 | 362 | #ifdef CONFIG_FEATURE_IPV6 |
363 | char *prefix; | 363 | char *prefix; |
364 | int prefix_len = 0; | 364 | int prefix_len = 0; |
365 | #endif | 365 | #endif |
366 | 366 | ||
367 | safe_strncpy(host, *argv, (sizeof host)); | 367 | safe_strncpy(host, *argv, (sizeof host)); |
368 | #if CONFIG_FEATURE_IPV6 | 368 | #ifdef CONFIG_FEATURE_IPV6 |
369 | if ((prefix = strchr(host, '/'))) { | 369 | if ((prefix = strchr(host, '/'))) { |
370 | prefix_len = atol(prefix + 1); | 370 | prefix_len = atol(prefix + 1); |
371 | if ((prefix_len < 0) || (prefix_len > 128)) { | 371 | if ((prefix_len < 0) || (prefix_len > 128)) { |
@@ -381,7 +381,7 @@ int ifconfig_main(int argc, char **argv) | |||
381 | if (!strcmp(host, bb_INET_default)) { | 381 | if (!strcmp(host, bb_INET_default)) { |
382 | /* Default is special, meaning 0.0.0.0. */ | 382 | /* Default is special, meaning 0.0.0.0. */ |
383 | sai.sin_addr.s_addr = INADDR_ANY; | 383 | sai.sin_addr.s_addr = INADDR_ANY; |
384 | #if CONFIG_FEATURE_IPV6 | 384 | #ifdef CONFIG_FEATURE_IPV6 |
385 | } else | 385 | } else |
386 | if (inet_pton(AF_INET6, host, &sai6.sin6_addr) > | 386 | if (inet_pton(AF_INET6, host, &sai6.sin6_addr) > |
387 | 0) { | 387 | 0) { |