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.

48 lines
1.4 KiB

  1. From e5773617afba7408c76ec2683814ce076c72c79d Mon Sep 17 00:00:00 2001
  2. From: Mark Stapp <mjs@voltanet.io>
  3. Date: Tue, 8 Dec 2020 09:10:10 -0500
  4. Subject: [PATCH] nhrpd: fix SA warning in nhrp_interface
  5. Clear SA warning from recent nhrp cache code changes.
  6. Signed-off-by: Mark Stapp <mjs@voltanet.io>
  7. ---
  8. nhrpd/nhrp_interface.c | 14 ++++++++++----
  9. 1 file changed, 10 insertions(+), 4 deletions(-)
  10. --- a/nhrpd/nhrp_interface.c
  11. +++ b/nhrpd/nhrp_interface.c
  12. @@ -327,7 +327,8 @@ struct map_ctx {
  13. bool enabled;
  14. };
  15. -static void interface_config_update_nhrp_map(struct nhrp_cache_config *cc, void *data)
  16. +static void interface_config_update_nhrp_map(struct nhrp_cache_config *cc,
  17. + void *data)
  18. {
  19. struct map_ctx *ctx = data;
  20. struct interface *ifp = cc->ifp;
  21. @@ -344,15 +345,20 @@ static void interface_config_update_nhrp
  22. c = nhrp_cache_get(ifp, &cc->remote_addr, ctx->enabled ? 1 : 0);
  23. if (!c && !ctx->enabled)
  24. return;
  25. +
  26. /* suppress */
  27. if (!ctx->enabled) {
  28. if (c && c->map) {
  29. - nhrp_cache_update_binding(c, c->cur.type, -1,
  30. - nhrp_peer_get(ifp, &nbma_addr), 0, NULL);
  31. + nhrp_cache_update_binding(
  32. + c, c->cur.type, -1,
  33. + nhrp_peer_get(ifp, &nbma_addr), 0, NULL);
  34. }
  35. return;
  36. }
  37. - /* create */
  38. +
  39. + /* Newly created */
  40. + assert(c != NULL);
  41. +
  42. c->map = 1;
  43. if (cc->type == NHRP_CACHE_LOCAL)
  44. nhrp_cache_update_binding(c, NHRP_CACHE_LOCAL, 0, NULL, 0,