diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-10-29 02:42:20 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-10-29 02:42:20 +0200 |
commit | 66cb7bed33da605674c3d24734466b8e8a60e337 (patch) | |
tree | da535f6baea65317c44d5028e5b8d26c5dcaf5d7 | |
parent | ec07420eb914f6ca62273c54790853ccf22636e8 (diff) | |
download | busybox-w32-66cb7bed33da605674c3d24734466b8e8a60e337.tar.gz busybox-w32-66cb7bed33da605674c3d24734466b8e8a60e337.tar.bz2 busybox-w32-66cb7bed33da605674c3d24734466b8e8a60e337.zip |
ifupdown: add manual method for IPv6. Closes bug 2497.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/ifupdown.c | 123 |
1 files changed, 68 insertions, 55 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 3cb1ec858..59df4e80f 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -164,7 +164,7 @@ static char *get_var(const char *id, size_t idlen, struct interface_defn_t *ifd) | |||
164 | return NULL; | 164 | return NULL; |
165 | } | 165 | } |
166 | 166 | ||
167 | #if ENABLE_FEATURE_IFUPDOWN_IP | 167 | # if ENABLE_FEATURE_IFUPDOWN_IP |
168 | static int count_netmask_bits(const char *dotted_quad) | 168 | static int count_netmask_bits(const char *dotted_quad) |
169 | { | 169 | { |
170 | // int result; | 170 | // int result; |
@@ -195,7 +195,7 @@ static int count_netmask_bits(const char *dotted_quad) | |||
195 | } | 195 | } |
196 | return result; | 196 | return result; |
197 | } | 197 | } |
198 | #endif | 198 | # endif |
199 | 199 | ||
200 | static char *parse(const char *command, struct interface_defn_t *ifd) | 200 | static char *parse(const char *command, struct interface_defn_t *ifd) |
201 | { | 201 | { |
@@ -258,17 +258,17 @@ static char *parse(const char *command, struct interface_defn_t *ifd) | |||
258 | varvalue = get_var(command, nextpercent - command, ifd); | 258 | varvalue = get_var(command, nextpercent - command, ifd); |
259 | 259 | ||
260 | if (varvalue) { | 260 | if (varvalue) { |
261 | #if ENABLE_FEATURE_IFUPDOWN_IP | 261 | # if ENABLE_FEATURE_IFUPDOWN_IP |
262 | /* "hwaddress <class> <address>": | 262 | /* "hwaddress <class> <address>": |
263 | * unlike ifconfig, ip doesnt want <class> | 263 | * unlike ifconfig, ip doesnt want <class> |
264 | * (usually "ether" keyword). Skip it. */ | 264 | * (usually "ether" keyword). Skip it. */ |
265 | if (strncmp(command, "hwaddress", 9) == 0) { | 265 | if (strncmp(command, "hwaddress", 9) == 0) { |
266 | varvalue = skip_whitespace(skip_non_whitespace(varvalue)); | 266 | varvalue = skip_whitespace(skip_non_whitespace(varvalue)); |
267 | } | 267 | } |
268 | #endif | 268 | # endif |
269 | addstr(&result, varvalue, strlen(varvalue)); | 269 | addstr(&result, varvalue, strlen(varvalue)); |
270 | } else { | 270 | } else { |
271 | #if ENABLE_FEATURE_IFUPDOWN_IP | 271 | # if ENABLE_FEATURE_IFUPDOWN_IP |
272 | /* Sigh... Add a special case for 'ip' to convert from | 272 | /* Sigh... Add a special case for 'ip' to convert from |
273 | * dotted quad to bit count style netmasks. */ | 273 | * dotted quad to bit count style netmasks. */ |
274 | if (strncmp(command, "bnmask", 6) == 0) { | 274 | if (strncmp(command, "bnmask", 6) == 0) { |
@@ -284,7 +284,7 @@ static char *parse(const char *command, struct interface_defn_t *ifd) | |||
284 | } | 284 | } |
285 | } | 285 | } |
286 | } | 286 | } |
287 | #endif | 287 | # endif |
288 | okay[opt_depth - 1] = 0; | 288 | okay[opt_depth - 1] = 0; |
289 | } | 289 | } |
290 | 290 | ||
@@ -329,56 +329,64 @@ static int execute(const char *command, struct interface_defn_t *ifd, execfn *ex | |||
329 | } | 329 | } |
330 | return 1; | 330 | return 1; |
331 | } | 331 | } |
332 | #endif | 332 | |
333 | #endif /* FEATURE_IFUPDOWN_IPV4 || FEATURE_IFUPDOWN_IPV6 */ | ||
334 | |||
333 | 335 | ||
334 | #if ENABLE_FEATURE_IFUPDOWN_IPV6 | 336 | #if ENABLE_FEATURE_IFUPDOWN_IPV6 |
337 | |||
335 | static int FAST_FUNC loopback_up6(struct interface_defn_t *ifd, execfn *exec) | 338 | static int FAST_FUNC loopback_up6(struct interface_defn_t *ifd, execfn *exec) |
336 | { | 339 | { |
337 | #if ENABLE_FEATURE_IFUPDOWN_IP | 340 | # if ENABLE_FEATURE_IFUPDOWN_IP |
338 | int result; | 341 | int result; |
339 | result = execute("ip addr add ::1 dev %iface%", ifd, exec); | 342 | result = execute("ip addr add ::1 dev %iface%", ifd, exec); |
340 | result += execute("ip link set %iface% up", ifd, exec); | 343 | result += execute("ip link set %iface% up", ifd, exec); |
341 | return ((result == 2) ? 2 : 0); | 344 | return ((result == 2) ? 2 : 0); |
342 | #else | 345 | # else |
343 | return execute("ifconfig %iface% add ::1", ifd, exec); | 346 | return execute("ifconfig %iface% add ::1", ifd, exec); |
344 | #endif | 347 | # endif |
345 | } | 348 | } |
346 | 349 | ||
347 | static int FAST_FUNC loopback_down6(struct interface_defn_t *ifd, execfn *exec) | 350 | static int FAST_FUNC loopback_down6(struct interface_defn_t *ifd, execfn *exec) |
348 | { | 351 | { |
349 | #if ENABLE_FEATURE_IFUPDOWN_IP | 352 | # if ENABLE_FEATURE_IFUPDOWN_IP |
350 | return execute("ip link set %iface% down", ifd, exec); | 353 | return execute("ip link set %iface% down", ifd, exec); |
351 | #else | 354 | # else |
352 | return execute("ifconfig %iface% del ::1", ifd, exec); | 355 | return execute("ifconfig %iface% del ::1", ifd, exec); |
353 | #endif | 356 | # endif |
357 | } | ||
358 | |||
359 | static int FAST_FUNC manual_up_down6(struct interface_defn_t *ifd UNUSED_PARAM, execfn *exec UNUSED_PARAM) | ||
360 | { | ||
361 | return 1; | ||
354 | } | 362 | } |
355 | 363 | ||
356 | static int FAST_FUNC static_up6(struct interface_defn_t *ifd, execfn *exec) | 364 | static int FAST_FUNC static_up6(struct interface_defn_t *ifd, execfn *exec) |
357 | { | 365 | { |
358 | int result; | 366 | int result; |
359 | #if ENABLE_FEATURE_IFUPDOWN_IP | 367 | # if ENABLE_FEATURE_IFUPDOWN_IP |
360 | result = execute("ip addr add %address%/%netmask% dev %iface%[[ label %label%]]", ifd, exec); | 368 | result = execute("ip addr add %address%/%netmask% dev %iface%[[ label %label%]]", ifd, exec); |
361 | result += execute("ip link set[[ mtu %mtu%]][[ addr %hwaddress%]] %iface% up", ifd, exec); | 369 | result += execute("ip link set[[ mtu %mtu%]][[ addr %hwaddress%]] %iface% up", ifd, exec); |
362 | /* Was: "[[ ip ....%gateway% ]]". Removed extra spaces w/o checking */ | 370 | /* Was: "[[ ip ....%gateway% ]]". Removed extra spaces w/o checking */ |
363 | result += execute("[[ip route add ::/0 via %gateway%]]", ifd, exec); | 371 | result += execute("[[ip route add ::/0 via %gateway%]]", ifd, exec); |
364 | #else | 372 | # else |
365 | result = execute("ifconfig %iface%[[ media %media%]][[ hw %hwaddress%]][[ mtu %mtu%]] up", ifd, exec); | 373 | result = execute("ifconfig %iface%[[ media %media%]][[ hw %hwaddress%]][[ mtu %mtu%]] up", ifd, exec); |
366 | result += execute("ifconfig %iface% add %address%/%netmask%", ifd, exec); | 374 | result += execute("ifconfig %iface% add %address%/%netmask%", ifd, exec); |
367 | result += execute("[[route -A inet6 add ::/0 gw %gateway%]]", ifd, exec); | 375 | result += execute("[[route -A inet6 add ::/0 gw %gateway%]]", ifd, exec); |
368 | #endif | 376 | # endif |
369 | return ((result == 3) ? 3 : 0); | 377 | return ((result == 3) ? 3 : 0); |
370 | } | 378 | } |
371 | 379 | ||
372 | static int FAST_FUNC static_down6(struct interface_defn_t *ifd, execfn *exec) | 380 | static int FAST_FUNC static_down6(struct interface_defn_t *ifd, execfn *exec) |
373 | { | 381 | { |
374 | #if ENABLE_FEATURE_IFUPDOWN_IP | 382 | # if ENABLE_FEATURE_IFUPDOWN_IP |
375 | return execute("ip link set %iface% down", ifd, exec); | 383 | return execute("ip link set %iface% down", ifd, exec); |
376 | #else | 384 | # else |
377 | return execute("ifconfig %iface% down", ifd, exec); | 385 | return execute("ifconfig %iface% down", ifd, exec); |
378 | #endif | 386 | # endif |
379 | } | 387 | } |
380 | 388 | ||
381 | #if ENABLE_FEATURE_IFUPDOWN_IP | 389 | # if ENABLE_FEATURE_IFUPDOWN_IP |
382 | static int FAST_FUNC v4tunnel_up(struct interface_defn_t *ifd, execfn *exec) | 390 | static int FAST_FUNC v4tunnel_up(struct interface_defn_t *ifd, execfn *exec) |
383 | { | 391 | { |
384 | int result; | 392 | int result; |
@@ -394,14 +402,15 @@ static int FAST_FUNC v4tunnel_down(struct interface_defn_t * ifd, execfn * exec) | |||
394 | { | 402 | { |
395 | return execute("ip tunnel del %iface%", ifd, exec); | 403 | return execute("ip tunnel del %iface%", ifd, exec); |
396 | } | 404 | } |
397 | #endif | 405 | # endif |
398 | 406 | ||
399 | static const struct method_t methods6[] = { | 407 | static const struct method_t methods6[] = { |
400 | #if ENABLE_FEATURE_IFUPDOWN_IP | 408 | # if ENABLE_FEATURE_IFUPDOWN_IP |
401 | { "v4tunnel", v4tunnel_up, v4tunnel_down, }, | 409 | { "v4tunnel" , v4tunnel_up , v4tunnel_down , }, |
402 | #endif | 410 | # endif |
403 | { "static", static_up6, static_down6, }, | 411 | { "static" , static_up6 , static_down6 , }, |
404 | { "loopback", loopback_up6, loopback_down6, }, | 412 | { "manual" , manual_up_down6 , manual_up_down6 , }, |
413 | { "loopback" , loopback_up6 , loopback_down6 , }, | ||
405 | }; | 414 | }; |
406 | 415 | ||
407 | static const struct address_family_t addr_inet6 = { | 416 | static const struct address_family_t addr_inet6 = { |
@@ -409,43 +418,46 @@ static const struct address_family_t addr_inet6 = { | |||
409 | ARRAY_SIZE(methods6), | 418 | ARRAY_SIZE(methods6), |
410 | methods6 | 419 | methods6 |
411 | }; | 420 | }; |
421 | |||
412 | #endif /* FEATURE_IFUPDOWN_IPV6 */ | 422 | #endif /* FEATURE_IFUPDOWN_IPV6 */ |
413 | 423 | ||
424 | |||
414 | #if ENABLE_FEATURE_IFUPDOWN_IPV4 | 425 | #if ENABLE_FEATURE_IFUPDOWN_IPV4 |
426 | |||
415 | static int FAST_FUNC loopback_up(struct interface_defn_t *ifd, execfn *exec) | 427 | static int FAST_FUNC loopback_up(struct interface_defn_t *ifd, execfn *exec) |
416 | { | 428 | { |
417 | #if ENABLE_FEATURE_IFUPDOWN_IP | 429 | # if ENABLE_FEATURE_IFUPDOWN_IP |
418 | int result; | 430 | int result; |
419 | result = execute("ip addr add 127.0.0.1/8 dev %iface%", ifd, exec); | 431 | result = execute("ip addr add 127.0.0.1/8 dev %iface%", ifd, exec); |
420 | result += execute("ip link set %iface% up", ifd, exec); | 432 | result += execute("ip link set %iface% up", ifd, exec); |
421 | return ((result == 2) ? 2 : 0); | 433 | return ((result == 2) ? 2 : 0); |
422 | #else | 434 | # else |
423 | return execute("ifconfig %iface% 127.0.0.1 up", ifd, exec); | 435 | return execute("ifconfig %iface% 127.0.0.1 up", ifd, exec); |
424 | #endif | 436 | # endif |
425 | } | 437 | } |
426 | 438 | ||
427 | static int FAST_FUNC loopback_down(struct interface_defn_t *ifd, execfn *exec) | 439 | static int FAST_FUNC loopback_down(struct interface_defn_t *ifd, execfn *exec) |
428 | { | 440 | { |
429 | #if ENABLE_FEATURE_IFUPDOWN_IP | 441 | # if ENABLE_FEATURE_IFUPDOWN_IP |
430 | int result; | 442 | int result; |
431 | result = execute("ip addr flush dev %iface%", ifd, exec); | 443 | result = execute("ip addr flush dev %iface%", ifd, exec); |
432 | result += execute("ip link set %iface% down", ifd, exec); | 444 | result += execute("ip link set %iface% down", ifd, exec); |
433 | return ((result == 2) ? 2 : 0); | 445 | return ((result == 2) ? 2 : 0); |
434 | #else | 446 | # else |
435 | return execute("ifconfig %iface% 127.0.0.1 down", ifd, exec); | 447 | return execute("ifconfig %iface% 127.0.0.1 down", ifd, exec); |
436 | #endif | 448 | # endif |
437 | } | 449 | } |
438 | 450 | ||
439 | static int FAST_FUNC static_up(struct interface_defn_t *ifd, execfn *exec) | 451 | static int FAST_FUNC static_up(struct interface_defn_t *ifd, execfn *exec) |
440 | { | 452 | { |
441 | int result; | 453 | int result; |
442 | #if ENABLE_FEATURE_IFUPDOWN_IP | 454 | # if ENABLE_FEATURE_IFUPDOWN_IP |
443 | result = execute("ip addr add %address%/%bnmask%[[ broadcast %broadcast%]] " | 455 | result = execute("ip addr add %address%/%bnmask%[[ broadcast %broadcast%]] " |
444 | "dev %iface%[[ peer %pointopoint%]][[ label %label%]]", ifd, exec); | 456 | "dev %iface%[[ peer %pointopoint%]][[ label %label%]]", ifd, exec); |
445 | result += execute("ip link set[[ mtu %mtu%]][[ addr %hwaddress%]] %iface% up", ifd, exec); | 457 | result += execute("ip link set[[ mtu %mtu%]][[ addr %hwaddress%]] %iface% up", ifd, exec); |
446 | result += execute("[[ip route add default via %gateway% dev %iface%]]", ifd, exec); | 458 | result += execute("[[ip route add default via %gateway% dev %iface%]]", ifd, exec); |
447 | return ((result == 3) ? 3 : 0); | 459 | return ((result == 3) ? 3 : 0); |
448 | #else | 460 | # else |
449 | /* ifconfig said to set iface up before it processes hw %hwaddress%, | 461 | /* ifconfig said to set iface up before it processes hw %hwaddress%, |
450 | * which then of course fails. Thus we run two separate ifconfig */ | 462 | * which then of course fails. Thus we run two separate ifconfig */ |
451 | result = execute("ifconfig %iface%[[ hw %hwaddress%]][[ media %media%]][[ mtu %mtu%]] up", | 463 | result = execute("ifconfig %iface%[[ hw %hwaddress%]][[ media %media%]][[ mtu %mtu%]] up", |
@@ -455,26 +467,26 @@ static int FAST_FUNC static_up(struct interface_defn_t *ifd, execfn *exec) | |||
455 | ifd, exec); | 467 | ifd, exec); |
456 | result += execute("[[route add default gw %gateway% %iface%]]", ifd, exec); | 468 | result += execute("[[route add default gw %gateway% %iface%]]", ifd, exec); |
457 | return ((result == 3) ? 3 : 0); | 469 | return ((result == 3) ? 3 : 0); |
458 | #endif | 470 | # endif |
459 | } | 471 | } |
460 | 472 | ||
461 | static int FAST_FUNC static_down(struct interface_defn_t *ifd, execfn *exec) | 473 | static int FAST_FUNC static_down(struct interface_defn_t *ifd, execfn *exec) |
462 | { | 474 | { |
463 | int result; | 475 | int result; |
464 | #if ENABLE_FEATURE_IFUPDOWN_IP | 476 | # if ENABLE_FEATURE_IFUPDOWN_IP |
465 | result = execute("ip addr flush dev %iface%", ifd, exec); | 477 | result = execute("ip addr flush dev %iface%", ifd, exec); |
466 | result += execute("ip link set %iface% down", ifd, exec); | 478 | result += execute("ip link set %iface% down", ifd, exec); |
467 | #else | 479 | # else |
468 | /* result = execute("[[route del default gw %gateway% %iface%]]", ifd, exec); */ | 480 | /* result = execute("[[route del default gw %gateway% %iface%]]", ifd, exec); */ |
469 | /* Bringing the interface down deletes the routes in itself. | 481 | /* Bringing the interface down deletes the routes in itself. |
470 | Otherwise this fails if we reference 'gateway' when using this from dhcp_down */ | 482 | Otherwise this fails if we reference 'gateway' when using this from dhcp_down */ |
471 | result = 1; | 483 | result = 1; |
472 | result += execute("ifconfig %iface% down", ifd, exec); | 484 | result += execute("ifconfig %iface% down", ifd, exec); |
473 | #endif | 485 | # endif |
474 | return ((result == 2) ? 2 : 0); | 486 | return ((result == 2) ? 2 : 0); |
475 | } | 487 | } |
476 | 488 | ||
477 | #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP | 489 | # if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP |
478 | struct dhcp_client_t { | 490 | struct dhcp_client_t { |
479 | const char *name; | 491 | const char *name; |
480 | const char *startcmd; | 492 | const char *startcmd; |
@@ -500,21 +512,21 @@ static const struct dhcp_client_t ext_dhcp_clients[] = { | |||
500 | "kill `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", | 512 | "kill `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", |
501 | }, | 513 | }, |
502 | }; | 514 | }; |
503 | #endif /* ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCPC */ | 515 | # endif /* FEATURE_IFUPDOWN_EXTERNAL_DHCPC */ |
504 | 516 | ||
505 | #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP | 517 | # if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP |
506 | static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd, execfn *exec) | 518 | static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd, execfn *exec) |
507 | { | 519 | { |
508 | unsigned i; | 520 | unsigned i; |
509 | #if ENABLE_FEATURE_IFUPDOWN_IP | 521 | # if ENABLE_FEATURE_IFUPDOWN_IP |
510 | /* ip doesn't up iface when it configures it (unlike ifconfig) */ | 522 | /* ip doesn't up iface when it configures it (unlike ifconfig) */ |
511 | if (!execute("ip link set[[ addr %hwaddress%]] %iface% up", ifd, exec)) | 523 | if (!execute("ip link set[[ addr %hwaddress%]] %iface% up", ifd, exec)) |
512 | return 0; | 524 | return 0; |
513 | #else | 525 | # else |
514 | /* needed if we have hwaddress on dhcp iface */ | 526 | /* needed if we have hwaddress on dhcp iface */ |
515 | if (!execute("ifconfig %iface%[[ hw %hwaddress%]] up", ifd, exec)) | 527 | if (!execute("ifconfig %iface%[[ hw %hwaddress%]] up", ifd, exec)) |
516 | return 0; | 528 | return 0; |
517 | #endif | 529 | # endif |
518 | for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { | 530 | for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { |
519 | if (exists_execable(ext_dhcp_clients[i].name)) | 531 | if (exists_execable(ext_dhcp_clients[i].name)) |
520 | return execute(ext_dhcp_clients[i].startcmd, ifd, exec); | 532 | return execute(ext_dhcp_clients[i].startcmd, ifd, exec); |
@@ -522,31 +534,31 @@ static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd, execfn *exec) | |||
522 | bb_error_msg("no dhcp clients found"); | 534 | bb_error_msg("no dhcp clients found"); |
523 | return 0; | 535 | return 0; |
524 | } | 536 | } |
525 | #elif ENABLE_UDHCPC | 537 | # elif ENABLE_UDHCPC |
526 | static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd, execfn *exec) | 538 | static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd, execfn *exec) |
527 | { | 539 | { |
528 | #if ENABLE_FEATURE_IFUPDOWN_IP | 540 | # if ENABLE_FEATURE_IFUPDOWN_IP |
529 | /* ip doesn't up iface when it configures it (unlike ifconfig) */ | 541 | /* ip doesn't up iface when it configures it (unlike ifconfig) */ |
530 | if (!execute("ip link set[[ addr %hwaddress%]] %iface% up", ifd, exec)) | 542 | if (!execute("ip link set[[ addr %hwaddress%]] %iface% up", ifd, exec)) |
531 | return 0; | 543 | return 0; |
532 | #else | 544 | # else |
533 | /* needed if we have hwaddress on dhcp iface */ | 545 | /* needed if we have hwaddress on dhcp iface */ |
534 | if (!execute("ifconfig %iface%[[ hw %hwaddress%]] up", ifd, exec)) | 546 | if (!execute("ifconfig %iface%[[ hw %hwaddress%]] up", ifd, exec)) |
535 | return 0; | 547 | return 0; |
536 | #endif | 548 | # endif |
537 | return execute("udhcpc " UDHCPC_CMD_OPTIONS " -p /var/run/udhcpc.%iface%.pid " | 549 | return execute("udhcpc " UDHCPC_CMD_OPTIONS " -p /var/run/udhcpc.%iface%.pid " |
538 | "-i %iface%[[ -H %hostname%]][[ -c %client%]][[ -s %script%]][[ %udhcpc_opts%]]", | 550 | "-i %iface%[[ -H %hostname%]][[ -c %client%]][[ -s %script%]][[ %udhcpc_opts%]]", |
539 | ifd, exec); | 551 | ifd, exec); |
540 | } | 552 | } |
541 | #else | 553 | # else |
542 | static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd UNUSED_PARAM, | 554 | static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd UNUSED_PARAM, |
543 | execfn *exec UNUSED_PARAM) | 555 | execfn *exec UNUSED_PARAM) |
544 | { | 556 | { |
545 | return 0; /* no dhcp support */ | 557 | return 0; /* no dhcp support */ |
546 | } | 558 | } |
547 | #endif | 559 | # endif |
548 | 560 | ||
549 | #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP | 561 | # if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP |
550 | static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec) | 562 | static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec) |
551 | { | 563 | { |
552 | int result = 0; | 564 | int result = 0; |
@@ -569,7 +581,7 @@ static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec) | |||
569 | result += static_down(ifd, exec); | 581 | result += static_down(ifd, exec); |
570 | return ((result == 3) ? 3 : 0); | 582 | return ((result == 3) ? 3 : 0); |
571 | } | 583 | } |
572 | #elif ENABLE_UDHCPC | 584 | # elif ENABLE_UDHCPC |
573 | static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec) | 585 | static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec) |
574 | { | 586 | { |
575 | int result; | 587 | int result; |
@@ -586,13 +598,13 @@ static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec) | |||
586 | result += static_down(ifd, exec); | 598 | result += static_down(ifd, exec); |
587 | return ((result == 3) ? 3 : 0); | 599 | return ((result == 3) ? 3 : 0); |
588 | } | 600 | } |
589 | #else | 601 | # else |
590 | static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd UNUSED_PARAM, | 602 | static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd UNUSED_PARAM, |
591 | execfn *exec UNUSED_PARAM) | 603 | execfn *exec UNUSED_PARAM) |
592 | { | 604 | { |
593 | return 0; /* no dhcp support */ | 605 | return 0; /* no dhcp support */ |
594 | } | 606 | } |
595 | #endif | 607 | # endif |
596 | 608 | ||
597 | static int FAST_FUNC manual_up_down(struct interface_defn_t *ifd UNUSED_PARAM, execfn *exec UNUSED_PARAM) | 609 | static int FAST_FUNC manual_up_down(struct interface_defn_t *ifd UNUSED_PARAM, execfn *exec UNUSED_PARAM) |
598 | { | 610 | { |
@@ -644,7 +656,8 @@ static const struct address_family_t addr_inet = { | |||
644 | methods | 656 | methods |
645 | }; | 657 | }; |
646 | 658 | ||
647 | #endif /* if ENABLE_FEATURE_IFUPDOWN_IPV4 */ | 659 | #endif /* FEATURE_IFUPDOWN_IPV4 */ |
660 | |||
648 | 661 | ||
649 | /* Returns pointer to the next word, or NULL. | 662 | /* Returns pointer to the next word, or NULL. |
650 | * In 1st case, advances *buf to the word after this one. | 663 | * In 1st case, advances *buf to the word after this one. |