busybox-1.9.0-iproute.patch 957 B

12345678910111213141516171819202122232425
  1. diff -urN busybox-1.9.0/networking/libiproute/iproute.c busybox-1.9.0-iproute/networking/libiproute/iproute.c
  2. --- busybox-1.9.0/networking/libiproute/iproute.c 2007-12-21 22:00:23.000000000 +0000
  3. +++ busybox-1.9.0-iproute/networking/libiproute/iproute.c 2008-01-04 15:18:33.000000000 +0000
  4. @@ -841,15 +841,17 @@
  5. /*0-3*/ "add\0""append\0""change\0""chg\0"
  6. /*4-7*/ "delete\0""get\0""list\0""show\0"
  7. /*8..*/ "prepend\0""replace\0""test\0""flush\0";
  8. - int command_num = 6;
  9. + int command_num;
  10. unsigned flags = 0;
  11. int cmd = RTM_NEWROUTE;
  12. + if (!*argv)
  13. + return iproute_list_or_flush(argv, 0);
  14. +
  15. /* "Standard" 'ip r a' treats 'a' as 'add', not 'append' */
  16. /* It probably means that it is using "first match" rule */
  17. - if (*argv) {
  18. - command_num = index_in_substrings(ip_route_commands, *argv);
  19. - }
  20. + command_num = index_in_substrings(ip_route_commands, *argv);
  21. +
  22. switch (command_num) {
  23. case 0: /* add */
  24. flags = NLM_F_CREATE|NLM_F_EXCL;