You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.5 KiB

  1. From acf6f22d150b0050afbdaf5887b8e25d1614db4c Mon Sep 17 00:00:00 2001
  2. From: Donatas Abraitis <donatas.abraitis@gmail.com>
  3. Date: Thu, 2 Jul 2020 11:08:29 +0300
  4. Subject: [PATCH 1/2] bgpd: Return bool type for ecommunity_add_val and
  5. subgroup_announce_check
  6. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
  7. ---
  8. bgpd/bgp_ecommunity.c | 6 +++---
  9. bgpd/bgp_route.c | 2 +-
  10. 2 files changed, 4 insertions(+), 4 deletions(-)
  11. diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c
  12. index d13da74b04..7d5cac4d62 100644
  13. --- a/bgpd/bgp_ecommunity.c
  14. +++ b/bgpd/bgp_ecommunity.c
  15. @@ -107,14 +107,14 @@ bool ecommunity_add_val(struct ecommunity *ecom, struct ecommunity_val *eval,
  16. p[1] == eval->val[1]) {
  17. if (overwrite) {
  18. memcpy(p, eval->val, ECOMMUNITY_SIZE);
  19. - return 1;
  20. + return true;
  21. }
  22. - return 0;
  23. + return false;
  24. }
  25. }
  26. int ret = memcmp(p, eval->val, ECOMMUNITY_SIZE);
  27. if (ret == 0)
  28. - return 0;
  29. + return false;
  30. if (ret > 0) {
  31. if (!unique)
  32. break;
  33. diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
  34. index 6ae7a59a14..7bfefde482 100644
  35. --- a/bgpd/bgp_route.c
  36. +++ b/bgpd/bgp_route.c
  37. @@ -1941,7 +1941,7 @@ bool subgroup_announce_check(struct bgp_node *rn, struct bgp_path_info *pi,
  38. /* Codification of AS 0 Processing */
  39. if (aspath_check_as_zero(attr->aspath))
  40. - return 0;
  41. + return false;
  42. if (CHECK_FLAG(bgp->flags, BGP_FLAG_GRACEFUL_SHUTDOWN)) {
  43. if (peer->sort == BGP_PEER_IBGP
  44. From d5a157b7c377081d23b136b5ba4849abdcbecd97 Mon Sep 17 00:00:00 2001
  45. From: Donatas Abraitis <donatas.abraitis@gmail.com>
  46. Date: Thu, 2 Jul 2020 11:39:40 +0300
  47. Subject: [PATCH 2/2] bgpd: Actually find the sequence number for
  48. large-community-list
  49. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
  50. ---
  51. bgpd/bgp_vty.c | 6 ++----
  52. 1 file changed, 2 insertions(+), 4 deletions(-)
  53. diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
  54. index 9c8f1e1def..67ff31df8f 100644
  55. --- a/bgpd/bgp_vty.c
  56. +++ b/bgpd/bgp_vty.c
  57. @@ -17235,8 +17235,7 @@ static int lcommunity_list_set_vty(struct vty *vty, int argc,
  58. char *cl_name;
  59. char *seq = NULL;
  60. - argv_find(argv, argc, "(1-4294967295)", &idx);
  61. - if (idx)
  62. + if (argv_find(argv, argc, "(1-4294967295)", &idx))
  63. seq = argv[idx]->arg;
  64. idx = 0;
  65. @@ -17285,8 +17284,7 @@ static int lcommunity_list_unset_vty(struct vty *vty, int argc,
  66. int idx = 0;
  67. char *seq = NULL;
  68. - argv_find(argv, argc, "(1-4294967295)", &idx);
  69. - if (idx)
  70. + if (argv_find(argv, argc, "(1-4294967295)", &idx))
  71. seq = argv[idx]->arg;
  72. idx = 0;