busybox-1.4.1-iproute.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. diff -urN busybox-1.4.1/networking/ip.c busybox-1.4.1-iproute/networking/ip.c
  2. --- busybox-1.4.1/networking/ip.c 2007-01-24 22:34:34.000000000 +0100
  3. +++ busybox-1.4.1-iproute/networking/ip.c 2007-01-27 14:07:05.000000000 +0100
  4. @@ -33,8 +33,9 @@
  5. if (ENABLE_FEATURE_IP_LINK && matches(argv[1], "link") == 0) {
  6. ret = do_iplink(argc-2, argv+2);
  7. }
  8. - if (ENABLE_FEATURE_IP_TUNNEL &&
  9. - (matches(argv[1], "tunnel") == 0 || strcmp(argv[1], "tunl") == 0)) {
  10. + if (ENABLE_FEATURE_IP_TUNNEL
  11. + && (matches(argv[1], "tunnel") == 0 || strcmp(argv[1], "tunl") == 0)
  12. + ) {
  13. ret = do_iptunnel(argc-2, argv+2);
  14. }
  15. if (ENABLE_FEATURE_IP_RULE && matches(argv[1], "rule") == 0) {
  16. diff -urN busybox-1.4.1/networking/libiproute/iproute.c busybox-1.4.1-iproute/networking/libiproute/iproute.c
  17. --- busybox-1.4.1/networking/libiproute/iproute.c 2007-01-24 22:34:33.000000000 +0100
  18. +++ busybox-1.4.1-iproute/networking/libiproute/iproute.c 2007-01-27 14:07:05.000000000 +0100
  19. @@ -835,9 +835,11 @@
  20. int do_iproute(int argc, char **argv)
  21. {
  22. - static const char * const ip_route_commands[] =
  23. - { "add", "append", "change", "chg", "delete", "get",
  24. - "list", "show", "prepend", "replace", "test", "flush", 0 };
  25. + static const char * const ip_route_commands[] = {
  26. + /*0-3*/ "add", "append", "change", "chg",
  27. + /*4-7*/ "delete", "get", "list", "show",
  28. + /*8..*/ "prepend", "replace", "test", "flush", 0
  29. + };
  30. int command_num = 6;
  31. unsigned int flags = 0;
  32. int cmd = RTM_NEWROUTE;
  33. @@ -848,7 +850,7 @@
  34. command_num = index_in_substr_array(ip_route_commands, *argv);
  35. }
  36. switch (command_num) {
  37. - case 0: /* add*/
  38. + case 0: /* add */
  39. flags = NLM_F_CREATE|NLM_F_EXCL;
  40. break;
  41. case 1: /* append */
  42. @@ -859,21 +861,20 @@
  43. flags = NLM_F_REPLACE;
  44. break;
  45. case 4: /* delete */
  46. - case 5: /* del */
  47. cmd = RTM_DELROUTE;
  48. break;
  49. - case 6: /* get */
  50. + case 5: /* get */
  51. return iproute_get(argc-1, argv+1);
  52. - case 7: /* list */
  53. - case 8: /* show */
  54. + case 6: /* list */
  55. + case 7: /* show */
  56. return iproute_list_or_flush(argc-1, argv+1, 0);
  57. - case 9: /* prepend */
  58. + case 8: /* prepend */
  59. flags = NLM_F_CREATE;
  60. - case 10: /* replace */
  61. + case 9: /* replace */
  62. flags = NLM_F_CREATE|NLM_F_REPLACE;
  63. - case 11: /* test */
  64. + case 10: /* test */
  65. flags = NLM_F_EXCL;
  66. - case 12: /* flush */
  67. + case 11: /* flush */
  68. return iproute_list_or_flush(argc-1, argv+1, 1);
  69. default:
  70. bb_error_msg_and_die("unknown command %s", *argv);