aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip-neighbor/ip_neighbor_watch.c
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2020-11-20 13:05:59 +0000
committerNeale Ranns <nranns@cisco.com>2020-11-25 12:57:16 +0000
commit4ac36bcb190b85e6541d27072157fdcee42bee23 (patch)
tree8c3da48e217bcef492b56deacd2e3c333ff5a683 /src/vnet/ip-neighbor/ip_neighbor_watch.c
parent38340fa32c96e9c6cb1593f03117dd504efbd5f4 (diff)
ip-neighbor: Send API event when neighbor is removed
Type: fix Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Change-Id: I9952497a108bac26445af95c28d4eed46099c2fc
Diffstat (limited to 'src/vnet/ip-neighbor/ip_neighbor_watch.c')
-rw-r--r--src/vnet/ip-neighbor/ip_neighbor_watch.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/vnet/ip-neighbor/ip_neighbor_watch.c b/src/vnet/ip-neighbor/ip_neighbor_watch.c
index 71d6440641d..72908f4e613 100644
--- a/src/vnet/ip-neighbor/ip_neighbor_watch.c
+++ b/src/vnet/ip-neighbor/ip_neighbor_watch.c
@@ -16,6 +16,7 @@
*/
#include <vnet/ip-neighbor/ip_neighbor.h>
+#include <vnet/ip-neighbor/ip_neighbor_watch.h>
#include <vnet/ip/ip_types_api.h>
#include <vnet/ethernet/ethernet_types_api.h>
@@ -174,7 +175,9 @@ ip_neighbor_unwatch (const ip_address_t * ip,
}
static void
-ip_neighbor_signal (ip_neighbor_watcher_t *watchers, index_t ipni)
+ip_neighbor_signal (ip_neighbor_watcher_t *watchers,
+ index_t ipni,
+ ip_neighbor_event_flags_t flags)
{
ip_neighbor_watcher_t *watcher;
@@ -185,12 +188,14 @@ ip_neighbor_signal (ip_neighbor_watcher_t *watchers, index_t ipni)
ip_neighbor_event_process_node.index,
0, 1, sizeof(*ipne));
ipne->ipne_watch = *watcher;
- ipne->ipne_index = ipni;
+ ipne->ipne_flags = flags;
+ ip_neighbor_clone(ip_neighbor_get(ipni), &ipne->ipne_nbr);
}
}
void
-ip_neighbor_publish (index_t ipni)
+ip_neighbor_publish (index_t ipni,
+ ip_neighbor_event_flags_t flags)
{
const ip_neighbor_t *ipn;
ip_neighbor_key_t key;
@@ -204,21 +209,21 @@ ip_neighbor_publish (index_t ipni)
p = mhash_get (&ipnw_db.ipnwdb_hash, &key);
if (p) {
- ip_neighbor_signal ((ip_neighbor_watcher_t*) p[0], ipni);
+ ip_neighbor_signal ((ip_neighbor_watcher_t*) p[0], ipni, flags);
}
ip_address_reset (&key.ipnk_ip);
p = mhash_get (&ipnw_db.ipnwdb_hash, &key);
if (p) {
- ip_neighbor_signal ((ip_neighbor_watcher_t*) p[0], ipni);
+ ip_neighbor_signal ((ip_neighbor_watcher_t*) p[0], ipni, flags);
}
key.ipnk_sw_if_index = ~0;
p = mhash_get (&ipnw_db.ipnwdb_hash, &key);
if (p) {
- ip_neighbor_signal ((ip_neighbor_watcher_t*) p[0], ipni);
+ ip_neighbor_signal ((ip_neighbor_watcher_t*) p[0], ipni, flags);
}
}