};
fib_walk_sync(FIB_NODE_TYPE_ADJ, walk_ai, &bw_ctx);
+ /*
+ * fib_walk_sync may allocate a new adjacency and potentially cuase a realloc
+ * for adj_pool. When that happens, adj pointer is no longer valid here.
+ * We refresh the adj pointer accordingly.
+ */
+ adj = adj_get (ai);
}
/*
* wouldn't be bad either, but that's more code than i'm prepared to
* write at this time for relatively little reward.
*/
+ /*
+ * adj_nbr_update_rewrite may actually call fib_walk_sync.
+ * fib_walk_sync may allocate a new adjacency and potentially cause
+ * a realloc for adj_pool. When that happens, adj pointer is no
+ * longer valid here. We refresh adj pointer accordingly.
+ */
+ adj = adj_get (ai);
arp_nbr_probe (adj);
}
break;
sw_if_index,
VNET_LINK_IP4,
VNET_REWRITE_FOR_SW_INTERFACE_ADDRESS_BROADCAST));
+ /*
+ * Caution: adj_nbr_update_rewrite may actually call fib_walk_sync.
+ * fib_walk_sync may allocate a new adjacency and potentially cause a
+ * realloc for adj_pool. When that happens, adj pointer is no longer
+ * valid here. Please refresh adj pointer accordingly if it is still
+ * needed after the aformentioned call.
+ */
break;
case IP_LOOKUP_NEXT_MCAST:
{